<< Ajax Controls, Error: ‘Sys.Extended.UI’ is null or not an object | Adding Roles and Membership to an SQL Server Database >>

Target Framework, .Net Framework 4.0 to .Net Framework 3.5

November 1 2010 15:02 / by: Bryan Didas / Filed in:.NET Framework, ASP.NET

I recently upgraded from Visual Web Developer 2008 to Visual Web Developer 2010 and have run into an issue, I started seeing a configuration error. In two cases I had been working on web applications in Visual Web developer 2010.

Case 1 appeared after I had opened an existing application and when prompted, do I want to configure the site for use with ASP.NET 4.0, I must have said yes.

Case 2 came when I created a new application and my system is setup to use Framework ASP.NET 4.0

In both situations I got the following error <compilation debug="true" targetFramework="4.0" /> pointing to my web.config file. I like working in Visual Web Developer 2010, but my hosting server is not yet setup for .Net Framework 4.0, so I needed to find out how to down-grade from 4.0 to 3.5 framework.

Config Error

 

The following is what I did to change the target Framework from ASP.NET 4.0 to ASP.NET 3.5.

1) Ensure IIS and the ASP.NET properties are configured for Framework 2.0. Note: Framework 3.5 will not show up in the list of installed options due to the fact that framework 3.5 is an extension of 2.0 and not a stand alone release.

 ASP.NET Properties

 

2) Configure you web application to use target Framework 4.0 by right clicking your website in the solution explorer >> Property Pages >> Build >> Change "Target Framework" to .NET Framework 3.5.

 VWD Site Properties

Then select the desired framework from the list.

VWD Build Properties 

This will update your web.config file with the correct information.

 

References:

The following links were used to find the solution.

NET Framework Developer Center, Forum: http://social.msdn.microsoft.com/Forums/en/netfxsetup/thread/a1bcee62-55a2-4fd2-8a78-1a1fbd95ebf3

MSDN Blog by Vijayshinva
http://blogs.msdn.com/b/vijaysk/archive/2008/03/20/running-asp-net-3-5-on-iis.aspx


Comments are closed