VB.NET based MVC Web Application - build errors after no code change - asp.net-mvc

I'm going to add my solution to this problem, but there must be other ways around it.
I'm building an MVC VB.NET based web app. Sometimes I won't even change the (previously working) code, and I'll try debugging using MSVS2010 - then I'll get the old "Build Errors" pop up.
This is annoying...
If anyone has a better solution than mine I'd be interested to know - I've heard about filters and stuff like that, maybe that's the route to go down... but for now, I'll post my very simple solution below.

The solution I discovered is simple, and I'm posting this because a lot of people might go down the same road that I did, and frantically Google reasons why previously working code now has build errors - a question I still don't know the answer to...
However, here's a simple workaround:
CLEAN!!!!
It's real easy, in MSVS2010, go to the "Build" dropdown from the toolbar, then press "Clean Solution".
Not sure why, but for some reason, this seems to work!

Related

How do I make my AndroidManifest.xml editable again?

I'm developing my first apps in Android Studio (3.1.2) and I've managed to complicate my life by making my AndroidManifest.xml file read-only in one of my projects. When I click on it in the Project view, it comes up as two panes side by side, neither of which is the view I'm used to from my other projects; the view on the right says "Merging Log Value provided by Gradle"; the view on the left only allows me to DELETE lines of the manifest but I want to add some lines. I assume these views are useful to someone but they aren't to me at the moment. I'm just trying to do a straight-forward edit on the file and I can't find any option to make it appear in the editable way that I'm used to from other projects. I think I must have clicked on something somewhere in the Android Studio GUI that caused this problem but I'm darned if I know what I did.
If someone could tell me how to make the file editable again, I'd be grateful for your guidance. Bonus points if you tell me how I messed myself up so that I can avoid doing it in the future!
It turns out this was very easily solved. I just noticed that there are TWO tabs available when you look at a manifest.xml and I was in the "merged manifest" tab. As soon as I clicked on the "text" tab, my manifest.xml file appeared in its normal fully-editable form.
I must have clicked on Merged Manifest - although I don't remember doing so! - and then simply not seen the tab again until just now.
My insomnia's been pretty bad this week so I'm going to chalk this up to that. :-)
Anyway, I'm just going to leave this question and answer here in case it helps someone else some time in the future.

When comparing files with TFS, only the deleted lines are shown

Let's say before I check in, on the team explorer I right click on a file and compare it to workspace/latest version (doesn't really matter which, and the location neither, it's the same thing with code reviews, Changeset details->compare with previous) it will only show the deleted/red lines in the file, although it does show the added (green) parts in the scrollbar.
Have anyone had this problem before? I imagine a reinstall might just work, but I'd like to avoid it, if I can.
If the error is only occurs for your machine. It's more likely related to VS. Usually reinstall vs is the final solution.
You can also try the suggestion as Sachi commented, try to clear TFS and VS cache. This may do the trick.
If it's not work, still suggest you to reinstall VS. Even though this may not be a good solution. After all, it's very likely you have taken a long time to trouble shooting the weird issue and still can't find the root cause.

Visual Studio 2013 Solution Explorer Not Showing Files

I am trying to start a side-project to learn some MVC coding.
I am having some weird behaviour when I have reopened my MVC project.
The classes I created "Backpacker" and "Booking" are not showing up in the solution explorer. I have tried pressing the "Show all files" button, but this does not help.
As you can see in the screenshots, I have the class file open, and the path is pointing to the current project. Also you can see that my classes are in the same directory as the other classes that are visible in the models folder.
Does anyone have any ideas as to why this is happening? It is hugely frustrating and I feel like maybe I have not configured something correctly?
Thanks in advance
//EDIT//
Darn it - I tried the "Show all files" once more and this time it seemed to "almost" work... see the newest screenshot.
However Visual Studio is still obviously not connecting them to the project correctly.... does anyone know why? or how to fix/prevent this in future?
Cheers.
Alright so this problem was my own fault. I overlooked something I had done without realising what was actually happening.
When I added my new classes through solution explorer, that was all done fine. However When I closed visual studio and had the following prompt:
I clicked "no" because I usually work with XSLT which doesn't require saving the solution for my changes to be kept.
When you add references to new class files in your project, the project needs to be saved or you will lose this data (duhhh).
To fix this issue I did the following:
And then made sure I SAVED THE SOLUTION changes.
Thanks for your help - hopefully this may be of use to other people.

Visual Studio 2010 ASP.NET MVC: Create Strongly Typed View Not Showing My Classes

For some reason, when I create a new view and select 'Create Strongly Typed View', when I try to select a view data class from my project I find that its not in the list?
Classes from all my project's references (external references) are there, but NONE of mine?
I know this can be done manually, but (bloody) visual studio wont allow me to select a page template unless a view data class has been selected. Im sure this is something I have forgetten or changed somewhere by mistake. Hope someone can help!
This is probably a stupid suggestion, but the only time this has happened to me has been when I've created a new ViewModel and tried to create a strongly typed view without building the project first.
I had this exact same issue, could not find the solution anywhere, and i really searched google, read many sites answers/suggestions, but nothing helped me, until i did this below.
Ok, you may have already figured out the answer by now, or even tried what i am about to suggest, but, save project, build project, just to be sure, then close project, then close vs altogether, then RUN VS AS ADMINISTRATOR, then open your project and add view, i bet you can now see the data classes in the View data class drop-down...!
Let me know if this worked for you.
//edit: just fyi, I don't think you would see this behavior in say Windows XP for instance, it must be due to the uac in Vista and 7, so I am assuming you are using one of these two. In my case i am using 7. I may have gotten this totally wrong, pardon me if i did, but it solved this issue for me, thanks.
//another edit: In fact, i think many problems with vs and sqlsrvr are related to permissions in vista and 7... just my thoughts.
Jimbo - again 'stupid suggestion'. but are you checking for the fully qualified name of the project.classname?? So if you're looking for 'Albums' in the class list from the 'zulu' project, you'd have to scroll down to 'zulu.Albums'...
just a thought
I need to close this question as the problem is gone now - the solution?
Install Visual Studio 2010 - sorted :)
If anyone does find out why this happens, please just drop me a comment here and I will re-open the question for a successful answer.
I had similar issue. I try all the suggestions but installing Visual studio seems big process,
Why not try rebuild the solution , then it show all the classes in the project ..Hope it definitely works

How can one use the "Add view" dialog in Visual Studio efficiently when working with ASP.NET MVC?

Does anyone else think that the add view dialog in VS is useless or is it just me?
Why is there no search/filtering in there? I can not even paste the type name (without namespace) there to speed up the view creation.
Plus, there are a lot of irrelevant classes there, including classes from all referenced libraries.
Am I missing something or Microsoft never did any usability testing with that??
Is it possible to filter out types/assemblies in the dialog and/or better navigation compared to manually scrolling the combobox with all the types listed? Is it possible to include only types from a particular directory/assembly/namespace? (the ViewModels namespace for example)
EDIT: As it seems from the answers that there is no usable workaround for this, I have filed a suggestion at Connect: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=507784
Please vote for the suggestion if you find this is an important issue.
There is search/filter, but it's a "starts with" search. Start typing and the list will be filtered.
You can paste the type name, but you do need the namespace.
No, I don't think you can remove assemblies.
Could it be improved? Sure. Some of your suggestions are good, and you should consider filing Connect reports for them. Is it useless, IMHO, no.
I tried the dialog in VS2010. As of beta 2, it behaves the same as VS2008, AFAICS. So get your suggestions in soon!
I mainly agree with you. While it's not competely useless, tha fact that all the classes from the referenced libraries show up and that it doesn't have a search box make it slow to add a new view. Maybe you could file a wishlist bug report on the ASP.NET MVC site...
As it seems from that there is no usable workaround for this, I have filed a suggestion at Connect.
In case anyone else feels that this dialog should be improved, please vote for the suggestion in Connect.
Resharper 5.0 implements this dialog very efficiently, solving all the described problems.

Resources