Question

I have a simple ASP.Net MVC project which for some reason has issues with intellisense. It is constantly giving me errors that namespaces local to the project can not be found, even though they do exist and the project will build fine. Here's an example:

enter image description here

It is very frustrating as this results in me having no intellisense available whatsoever. Has any one encountered a problem like this before, and do they know of a solution?

The project itself is an MVC4 website running in VS2013 in W8 under Paralells on a Macbook Air, should that have any effect on the problem.

As stated, I have no error messages to provide as the project builds and runs successfully, but please let me know if more details are required.

Was it helpful?

Solution

I had the same issue. Try removing your project from the solution and then add it again. It worked for me. Looks like a solution file quirk.

UPDATE: this is not a permanent fix as closing and reopening visual studio brings back the issue.

UPDATE 2: while looking to fix another issue where I couldn't change the default namespace of a project (I would get a System.Runtime.InteropServices.ExternalException), I found out that it was related to Xamarin tools for Visual Studio. I proceeded to completely uninstall Xamarin. It fixed my namespace renaming issue as well as the weird type or namespace not found / intellisense issue.

OTHER TIPS

I had this same issue, seems to be something with the solution file and building the project as I could replicate the problem by simply creating a new project building then restarting visual studio.

Anyway I get around it at the moment by deleting the solution file and opening the project using the project file.

For anyone reading this in 2020, a fix that I've found that has worked for me is:

  • cleaning the solution and unloading the projects that have dependencies such as a web API depending on a data project and an application project (right click on the project in solution explorer and find "Unload Project"),
  • then reloading and building each project in the order of dependence such that they build successfully (right click on the unloaded project in solution explorer and find "Reload Project").

so in my case my data project does not depend on any other project so I reloaded and built that first, then the application project which depends on the data project and finally the web API project which depended on both data and application.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top