Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

Whenever I try to compile my VS2015 application, I a long list of errors like:

The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

However, as soon as I double click the error to view the file, it opens the file, has a slight delay, then clears ALL the errors.

If I proceed to try and build again, I get the same list of errors and the process repeats itself.

UPDATE I forgot to mention that I have tried:

  1. following the advice in several other SO questions - to no avail
  2. ensuring the dlls are set to copy to local
  3. removing and re-adding references
  4. deleting dlls from the application and adding them back
  5. cleaning and rebuilding the application
  6. restarting the application and my computer

What would cause this? How do I eliminate it?

like image 542
davids Avatar asked Dec 18 '22 19:12

davids


1 Answers

  • Restart Visual studio
  • Remove the assembly reference and re-add it
  • Do a clean and re-build
  • Try install Microsoft.AspNET.MVC from nuget package manager
like image 90
Nick Avatar answered Jan 05 '23 00:01

Nick