Dela via


How to: Choose the .NET Framework Version for Applications

In Visual Studio Team System Architecture Edition, you can choose the .NET Framework version for an ASP.NET, Windows, or Office application on the application diagram. This action specifies the .NET Framework version that you want the application's project to target after you implement the application.

To choose the .NET Framework version for an unimplemented application

  1. Right-click the application on the application diagram and click Properties.

  2. In the Properties window, set the Target Framework property to the .NET Framework version that you want the application to target.

  3. If the Operating System constraint is selected, confirm that it specifies the .NET Framework version that the application will require on the logical server for deployment.

    Note

    To find this constraint, right-click the application and click Settings and Constraints. In the Settings and Constraints Editor, expand the Logical Server Constraints node, expand the logical server node, and click the Operating System node (not the box). You will see the constraint in the editor pane.

Visual Studio will automatically update the application's Target Framework setting when you change the Target Framework property. Visual Studio will validate this setting against the logical server's CommonLanguageRuntime setting when you evaluate deployment. 

Note

Changing the Target Framework setting will not update the Target Framework property. If you change this setting, update the Target Framework property manually. To find this setting, right-click the application and click Settings and Constraints. In the Settings and Constraints Editor, click Application Settings. You will see the setting in the editor pane.

When the Operating System constraint is selected, Visual Studio will validate this constraint against the logical server's CommonLanguageRuntime setting when you evaluate deployment. When this constraint is not selected, Visual Studio validates only the Target Framework setting.

Visual Studio validates only the Target Framework setting and the Operating System constraint, if it is selected. It does not validate the Target Framework property. You will not get a validation warning if the Target Framework property does not match the setting or the constraint.

For more information, see Applying Settings, Constraining Application and Application Hosting Relationships, and "Considerations After Implementation" in Considerations for Implementing Applications.

To change the .NET Framework version for an implemented application

  1. Update the application project's properties by following the instructions in Targeting a Specific .NET Framework.

    This action updates the .NET Framework version referenced by an application project.

  2. If the Operating System constraint is selected, confirm that it specifies the .NET Framework version that the application will require on the logical server for deployment.

    Note

    To find this constraint, right-click the application and click Settings and Constraints. In the Settings and Constraints Editor, expand the Logical Server Constraints node, expand the logical server node, and click the Operating System node (not the box). You will see the constraint in the editor pane.

  3. Confirm that the Target Framework setting specifies the same version as the project's properties.

    Note

    To find this setting, right-click the application and click Settings and Constraints. In the Settings and Constraints Editor, click Application Settings. You will see the setting in the editor pane.

When you change the project's properties, Visual Studio will not automatically update the Target Framework setting. Visual Studio will validate this setting against the logical server's CommonLanguageRuntime setting when you evaluate deployment. Also, Visual Studio will not update the application's Target Framework property in the Properties window. The property will always be empty and read-only on an implemented application.

Visual Studio validates only the Target Framework setting and the Operating System constraint, if it is selected. It does not validate the project's properties. You will not get a validation warning if the project's properties do not match the setting or the constraint.

For more information, see Applying Settings, Constraining Application and Application Hosting Relationships, and "Considerations After Implementation" in Considerations for Implementing Applications.

See Also

Other Resources

Defining Applications on Application Diagrams

Implementing Applications on Application Diagrams

Reverse-Engineering in Existing Solutions