Targeting .NET3.5 with ASP.NET MVC2 Web Application in Visual Studio 2010?

682 Views Asked by At

Our current environment is .NET 3.5 SP1 but we're in the process of migrating to .NET4 and Visual Studio 2010.

I would like to stick to using .NET 3.5 for the deployment/production environment however use Visual Studio and TFS 2010 for development, until the production environment is cleared for upgrade to .NET4. Is this possible (I assume yes :B), and how?

What I have tried is changing the TargetFrameworkVersion in the project settings to "v3.5". However, I get a build failure due to the classes in System.Web.Security that moved to System.Web.ApplicationServices in .NET 4 (e.g. MembershipUser) not being found... so it appears that it is using .NET4 libraries and not .NET3.5? Do I add the System.Web.ApplicationServices library to my project, and if so, does this mean it will still run on .NET 3.5?

Also, I noticed that the ToolsVersion of the project is 4.0, would changing it from 4.0 to 3.5 be the correct thing to do? When I do this, re-opening the project causes Visual Studio to run the conversion process, changing the ToolsVersion back to 4.0 ...

Cheers,

James

1

There are 1 best solutions below

1
On

You must have Visual Studio 2008 installed to be able to target .NET 3.5 in Visual Studio 2010.