.net – How to install ASP.net MVC 2 on Windows Server 2008 R2

asp.netasp.net-mvcinstallationnetwindows-server-2008

Currently I'm in the process of deploying my ASP.net MVC 2 project on a Windows Server 2008 R2 web server. This web server already has the .net 4 Framework installed, but doesn't have any MVC dll's in the GAC.

So deployment on IIS succeeds, but when I start up the web application in the browser, it results in this message:

Could not load file or assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Of course I can Google myself too and it mainly suggests:

  • Copying the MVC dll's (System.Web.Mvc.dll, .Routing.dll, etc) to the output directory;
  • Downloading an RTM version of ASP.net MVC 2 on top of .net 3.5 Framework.

Neither of them I'd like to do. I just want to install ASP.net MVC 2 to the GAC of my web server. So my question is:

  • Which installation does actually contain ASP.net MVC 2 for installation on top of .net 4?

Thanks in advance!!

Best Answer

If you already have .NET 4.0 installed on the server and your application is targeting .NET 4.0 you don't need to install anything. ASP.NET MVC 2 is included in .NET 4.0. Just make sure that your web application is targeting .NET 4.0 and using the assemblies already present in the GAC. If you are targeting .NET 3.5 (CLR 2.0 application pool) you will need to install the ASP.NET MVC 2.0 by downloading it from MSDN.


UPDATE:

ASP.NET MVC 2 is included in the VS2010 install and not part of .NET 4.0. So you need to download and install it from MSDN.