Visual Studio 2012 IDE Complaint about namespaces after upgrade

I recently upgraded a VS 2010 solution to a VS 2012 solution. It is a solution with various class libraries and an MVC web application. I upgraded all projects to .NET 4.5, but have this weird error.

The solution is 100% built, but whenever I am in the controller (any controller), any references to classes in my MVC project are unrecognized, i.e. I get the "Namespace name type" xxx "cannot be found, etc. ' and I don’t have intelligence on any of my own classes, etc., but the project is built and works fine.

Any ideas ??? And yes, it is very sporadic, it will work from one minute and will not be the next.

+4
source share
6 answers

Run Build β†’ Clean Solution .

or..

Right-click the project that Visual Studio cannot find the link and select Clear .

+3
source

I assume you have resharper installed?

Try: Tools-> Import and Export Settings β†’ Reset all settings

+2
source

I had the same problem, I tried a complete reinstall for deletion, I tried a full uninstall and deleted all the remnants that I could manually find and reinstall. I tried repairing through setup, still nothing.

I tried to create new users in the OS and load them through the same problem. I tried to run visual studio using devenv.exe / resetsettings, I also tried devenv.exe / safe, but still nothing.

In the same release, I ended up doing a full cleanup of my OS to get this fix. In no case can I fix it, but I literally tried everything I could. There is definitely something wrong: setup.exe is not installed correctly under certain circumstances causing this ...

I want to add that for me it was not a type of project. Although at first I thought it was since I used the MVC Project types mainly, but I created a couple of other project types and it still had a problem ...

+2
source

Just fixed it on one of my solutions.

Open the project file in notepad. If you look at the links they have with relative locations. Replace everything with absolute file locations.

for example ... \ packages should be c: \ myproject \ packages

Reopen in Visual Studio, and everything should be fine.

+1
source

I have the same problem almost daily; I have not yet found a permanent fix, but I found that running the following command from the command line will fix it in about 60% of cases (if you want to close the IDE first):

del /F /Q %LocalAppData%\Microsoft\WebsiteCache 

I ended up putting this in a .cmd file on my desktop, which I run as needed. Not very, but faster than the other solution I found (completely clear the solution / project directories and pull out a new copy from TFS).

+1
source

I recently encountered this situation after converting an application built in an old version of VS. My fix was to change the main application intended for .Net version from 3.5 to 4.5 to match the target structure of my links.

0
source

Source: https://habr.com/ru/post/1436370/


All Articles