views:

27

answers:

2

We are upgrading some of our VS2008 solutions to VS2010, but we are not yet prepared to go to .NET 4.0 on all our projects. At the same time, we are looking at a move from MVC 1.0 to 2.0. I know that there are MVC 2.0 assemblies/code compiled against both the 3.5 and 4.0 .NET Frameworks, but will these two MVC versions live side-by-side in the GAC of a single machine? Meaning, can I deploy both an MVC 2/.NET 3.5 site and also an MVC 2/.NET 4 site on the same server, provided that the server has both frameworks installed and I have run both the "MVC 2 2008" and "MVC 2 2010" installers?

A: 

There is only a single System.Web.Mvc.dll v2 assembly, and it is compiled against .NET 3.5. (Though it will also run correctly on .NET 4.) The end result is that if you have MVC v2 GACed, it will automatically operate correctly on both ASP.NET 3.5 and ASP.NET 4 sites.

Levi
Ah, interesting. I was thrown by the fact that the MVC team had different installers/versions during the 2010 beta and also by the fact that if you want VS 2010 to upgrade your MVC to 2.0, it does so as part of a .NET 4.0 upgrade as well. I guess I can do the .NET 4.0 upgrade on my project and then manually reset the target framework to 2.0/3.5?
Tony
Upgrading an MVC 1 project to MVC 2 using the VS2010 wizard should leave the project as a .NET 3.5 project. It shouldn't upgrade it to .NET 4. So the additional downgrade step you mention should be unnecessary. (Make a backup first in case the upgrade fails, of course.)
Levi
A: 

The only thing you need to worry about is if you are putting your own assemblies in the gac, and you have the same dll in both .net 4 and 3.5. If so just use different version numbers and different snk.

Ben Robinson