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 framework in an existing 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, you can later retarget the project 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 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. Then click the OK button.
The following steps show how to change the targeted framework in an existing Visual Basic, Visual C#, or Visual F# project.
To change the targeted .NET Framework version in an existing project
Open the project you want to change.
In the Solution Explorer toolbar, choose the Properties button.
You can also select the project node in Solution Explorer, open the context menu (by right-clicking the node), and select Properties.
You should see the settings on the Application tab. If you do not, select it.
In the Target Framework dropdown list, choose the .NET Framework version that you want. Then click the OK button.
The project unloads and then reloads. It now targets the 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. To resolve these errors, you must modify the references. For more information, see Troubleshooting .NET Framework Targeting Errors.