davids
davids

Reputation: 5587

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?

Upvotes: 5

Views: 28443

Answers (3)

Ruhith Udakara
Ruhith Udakara

Reputation: 2452

try download and copy System.Web.Mvc.dll into your project bin folder

Upvotes: -1

Alex G
Alex G

Reputation: 595

in my case it worked only after I run in the Package Manager Console following command

PM> Install-Package Microsoft.AspNet.Mvc

My environment was:

1) Visual Studio 2017
2) Freshly created Angular 4 app
3) MVC 6 as a back end

Upvotes: 2

Nick
Nick

Reputation: 1863

  • 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

Upvotes: 10

Related Questions