8 out of 34 rated this helpful - Rate this topic

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.

Note Note

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

  1. On the menu bar, choose File, New, Project.

  2. 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.

    Note Note

    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.

  3. 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

  1. Open the project you want to change.

  2. In the Solution Explorer toolbar, choose the Properties button.

  3. You can also select the project node in Solution Explorer, open the context menu (by right-clicking the node), and select Properties.

  4. You should see the settings on the Application tab. If you do not, select it.

  5. 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.

    Note Note

    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.

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.