5

A colleague emailed me an example ASP.NET MVC project that won't build on my machine as it contains a reference to System.Web.Mvc.dll

In the .csproj file:

<Reference Include="System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />

I have VS2008 SP1 installed and can create new ASP.NET MVC web applications. However these don't include a reference to this assembly.

So, does anyone know in what version(s) of ASP.NET MVC this assembly exists, and what I should do to get this project to build?

Edit

How can I find out what version of ASP.NET MVC is installed on a machine?

Richard Ev
  • 48,781
  • 54
  • 181
  • 273

4 Answers4

7

MVC just went RTM. You may be running an earlier version. Get the latest one.

ASP.NET MVC 1.0 includes the assembly System.Web.Mvc.dll

Richard Ev
  • 48,781
  • 54
  • 181
  • 273
John Saunders
  • 157,405
  • 24
  • 229
  • 388
4

To find out what version of MVC is installed:

Search Program Files\Microsoft ASP.NET for System.Web.Mvc.dll.

It should be in a folder that has the release name on it or failing that right click and check the properties.

To fix your problem:

  1. From within Visual Studio expand the references section and delete the current reference to System.Web.Mvc (right click "Remove").
  2. Right click on References and select "Add Reference"
  3. Select System.Web.MVC from the .NET tab.
  4. Rebuild your application.

It should now compile and run.

ChrisF
  • 127,439
  • 29
  • 243
  • 315
3

You can also go to: http://www.microsoft.com/web/

And download the Web Platform Installer and install the MVC and other stuff through it.

Community
  • 1
  • 1
SirDemon
  • 1,730
  • 15
  • 24
0

Here is my answer -

Best way is to use NuGet package manager. Just update the below MVC package and it should work

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

Community
  • 1
  • 1
sandeep talabathula
  • 3,008
  • 3
  • 26
  • 37