views:

3178

answers:

3

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?

+5  A: 

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

John Saunders
A: 

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.

SirDemon
+2  A: 

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