
How the ToolsVersion Attribute Works
When you create a new project, or upgrade an existing project in Visual Studio 2008, an attribute named ToolsVersion is automatically included in the project file and set to a default value of "3.5". For more information, see Targeting a Specific .NET Framework.
When a ToolsVersion value is defined in a project file, MSBuild uses it to determine the values for $(MSBuildToolsPath) (or $(MSBuildBinPath)), which is the path of the MSBuild tools. If a ToolsVersion value is not defined, MSBuild continues to use the old Toolset path because it assumes that the project is a Visual Studio 2005 project.
If you open an existing Visual Studio 2005 project in Visual Studio 2008, the project is physically "upgraded" to include "ToolsVersion=3.5" since Visual Studio 2008 only supports building with the 3.5 toolset. As a result, when you build the project in Visual Studio 2008, it will use the Visual Studio 2008 Toolset (3.5) instead of the Visual Studio Toolset (2.0).
Projects created by using the 2.0 Toolset can target the .NET Framework 2.0, and projects created by using the 3.5 Toolset can target versions 2.0, 3.0, or 3.5 of the .NET Framework. Even if a Visual Studio project has been migrated to Visual Studio 2008 and upgraded to use the 3.5 Toolset, the Target Framework for the project will continue to be .NET Framework 2.0. This design guarantees that when you migrate your project to Visual Studio 2008, it will not introduce new dependencies. The project continues to build exactly as it did in Visual Studio.
Note: |
|---|
If ToolsVersion is already defined in a project,
Visual Studio 2008 will not change its value. The ToolsVersion value can be overridden. For more information, see Overriding ToolsVersion Settings.
|