Your official information source from the .NET Web Development and Tools group at Microsoft.
The multi-targeting feature of Visual Studio 2010 allows web developers to develop web applications targeting ASP.NET 2.0, 3.0, 3.5 and 4.0. The key benefit of multi-targeting is that you can use Visual Studio 2010 to create and develop new projects that target earlier versions of the .NET Framework (such as 2.0, 3.0 and 3.5). Multi-targeting in VS 2010 also lets you continue to develop projects that were created using earlier versions of Visual Studio such as Visual Studio 2005 and Visual Studio 2008.
What's different about Multi-targeting in Visual Studio 2010?
We supported multi-targeting of web applications in Visual Studio 2008 as well. But the capabilities we had for multi-targeting in VS 2008 were really a pseudo form of multi-targeting, i.e. even though VS 2008 allowed us to target different versions of the ASP.NET framework 2.0, 3.0 and 3.5, the underlying Common Language Runtime (CLR) for all these frameworks is the same (= the .NET CLR 2.0). With the release of the new ASP.NET 4.0 Beta1 framework (that runs on top of the .NET CLR 4.0 that installs side-by-side with earlier versions of the .NET CLR) along with Visual Studio 2010 Beta1, we now have the ability in Visual Studio to target ASP.NET framework versions spanning multiple versions of the CLR (CLR 2.0 and CLR 4.0).
VS 2010 can detect when your web project is targeting ASP.NET 2.0, 3.0 or 3.5 (that runs on top of CLR 2.0) versus targeting ASP.NET 4.0 (that runs on top of CLR 4.0).
New capabilities in VS 2010:
We already had the above multi-targeting capabilities in VS 2008. VS 2010 extends these capabilities to handle ASP.NET 4.0 (and the new CLR 4.0). Additionally, in VS 2010,
Figure 2 – ASP.NET Development Server icon in System Tray
IIS 7 and application pools
When using web projects with IIS 7, you can only specify one CLR version per application pool in IIS. Therefore, a web project targeting ASP.NET 4.0 (and CLR 4.0) cannot be in the same application pool as a web project targeting ASP.NET 3.5 or lower (CLR 2.0) in IIS 7.
When creating new or re-targeting existing localhost IIS WAPs and IIS websites (HTTP websites) using VS 2010 (example, as in Figure 4), it will automatically set the application pool in IIS for you based on the .NET framework that the web project is targeting. (Remember that you need to run VS as admin if you are using IIS as your development server rather than the built-in ASP.NET Development Server). If an application pool for the current runtime version does not already exist in IIS, VS 2010 will create one for you and then assign the web project to this newly created application pool. You can verify this by selecting the application in IIS and viewing the Basic Settings (as shown in Figure 5). VS 2010 does not automatically update the application pool on a remote server, however.
Converting web projects from earlier versions of Visual Studio to Visual Studio 2010
Conversion of projects creating using VS 2005 and VS 2008 to VS 2010
VS 2010 supports conversion of a web project created using VS 2005 or VS 2008 to the latest version of Visual Studio so that you can take advantage of the new features that are available. The feature works similar to the conversion behavior in VS 2008 - you will be presented with the Visual Studio Conversion Wizard that will walk you through the steps to convert your project to VS 2010 (see figure 6). Like in VS 2008, during conversion of your project, a prompt will appear (see figure 7) allowing you to continue targeting the lower .NET framework version such as ASP.NET 2.0, 3.0 or 3.5, or optionally, upgrade the project to target the latest .NET framework version ASP.NET 4.0.
Conversion of projects creating using VS 2003
VS 2010 also supports limited conversion of a web project created using VS 2003. As above, you will get the conversion wizard but there will not be a prompt allowing you to remain in the lower ASP.NET 1.1 framework. This is because VS 2010 only supports targeting of frameworks 2.0 and above. Rather, the ASP.NET 1.1 web project will get upgraded to a ASP.NET 4.0 Web Application Project.
Note: It is always a good practice to take a backup of your web project before converting it to a newer version of Visual Studio.
Bala Chirtsabesan | SDET | Visual Studio Web Developer
The multi-targeting feature of Visual Studio 2010 allows web developers to develop web applications targeting
Thanks for improving multi-targeting feature in VS010, Nice Job!
Interesting Finds: June 7, 2009
Hey, I have a question. But first, my compliments, multi-targeting is a great feature, although the frameworkmoniker attribute is somewhat 'weird'.
Anyway, when (ASP).NET was evolving with AJAX and C# 3.0 etc, Scott Gu told us on his blog that the web.config was getting so large because Microsoft could not change the existing config files since those were part of the CLR 2.0 installation, and changing them could have compatibility consequences. This was in reaction to complaints that it was growing to large and difficult to understand/explain.
Now that there is a new CLR installed, I am surprised to see that the local web.config is specifying v4.0 compiler options, v4.0 assemblies, configSections etc. Couldn't those configurations be consolidated at the machine level? I hope so, there's nothing like a 3-line web.config to start a new project!
Looking forward to your reaction,
VS2008 also give this feature already, we can create 2.0,3.0,3.5 sites. Definitely, 1.0 is discard forever!
Thank you for submitting this cool story - Trackback from DotNetShoutout
You bring up good points regarding the frameworkMoniker attribute and having a simple web.config to start with when we create a new 4.0 project. Both of these are under consideration to be fixed for the Beta 2 release of Visual Studio 2010.
My latest in a series of the weekly, or more often, summary of interesting links I come across related to Visual Studio. Greg Duncan has posted a few good links: Free Training of the Week – Seven hours of free, for a limited time, .Net (C#/VB) training