Why is System.Web.Mvc not listed in Add References?

Using C#, Visual Studio 2010.

There is a namespace called System.Web.Mvc documented on MSDN. The documentation for all the types in that namespace says that they are in System.Web.Mvc.dll.

However, when I go to Add Reference, “.NET” tab, this assembly is missing from the list. Why?


Solution 1:

Best way is to use NuGet package manager.

Just update the below MVC package and it should work.

enter image description here

Solution 2:

In VS Express 2012 I couldn't find System.Web.Mvc in the "assemblies" tab, but after a bit of searching I found out that I need to look into "assemblies\extensions" tab rather than the default "assemblies\framework" tab.

Solution 3:

I had the same issue and wasn't able to locate the System.Web.MVC reference assembly.

Finally found out and it was located inside the following location.

Note if your VS was installed in C: (Sometimes the MVC.dll is not in the default location which everybody talk about, i mean the "Reference Assemblies" folder located in the C: drive.)

if its not there, it should definitely be in here:

\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 2\Assemblies\System.Web.Mvc.dll

So add the dll through navigating or the browse tab in the add reference menu.