How to: Target a Version of the .NET Framework
This document describes how to create a project that targets a version of the .NET Framework, and how to change the targeted version in an existing Visual Basic, Visual C#, or Visual F# project. For information about how to change the .NET Framework version for C++ projects, see How to: Modify the Target Framework and Platform Toolset.
In Express Editions of Visual Studio, a .NET Framework version or profile cannot be specified when a project is created. However, in an existing project, you can change the target to any installed .NET Framework version.
The following steps show how to target a version of the .NET Framework when you create a project. The set of available project templates depends on the .NET Framework version you select.
To target a version of the .NET Framework when you create a project
On the menu bar, choose File, New, Project.
In the list at the top of the New Project dialog box, choose the version of the .NET Framework that you want your project to target.
Typically, only one version of the .NET Framework is installed together with Visual Studio. If you want to target another version, you must first make sure that it is installed. For more information, see Visual Studio Multi-Targeting Overview.
In the list of installed templates, choose the type of project that you want to create. The list of templates is automatically filtered to show only those projects that are supported by the version of the .NET Framework that you selected.
Choose the OK button.
The following steps show how to change the targeted .NET Framework version in an existing Visual Basic, Visual C#, or Visual F# project.
To change the targeted .NET Framework version in an existing project
In Solution Explorer, open the shortcut menu for the project you want to change and then choose Properties.
In the left column of the property pages window, select the Application tab.
C++ projects require a different procedure, see How to: Modify the Target Framework and Platform Toolset.
In the Target Framework drop-down list, select the .NET Framework version that you want. In the verification dialog box that appears, choose the Yes button.
The project unloads and then reloads. It now targets the .NET Framework version that you just selected.
If you change the .NET Framework version but your code contains references to a different version, you may receive error messages at compile time or at run time. To resolve these errors, you must modify the references. For more information, see Troubleshooting .NET Framework Targeting Errors.