Visual RPG Language Tour  

.NET Framework Multi-Targeting Support

 

Visual RPG applications enable the multi-targeting feature of Visual Studio 2008; which lets you specify the .NET Framework version that is required to use your application. The benefit to multi-targeting is that you can use Visual Studio 2008 to create projects that target .NET Framework version 2.0, 3.0, or 3.5. You can also continue to develop projects that were created in Visual Studio 2005 without adding new .NET Framework dependencies. This feature helps guarantee that applications use only the functionality that is available in the specified .NET Framework version. It also lets you continue to deploy older applications without requiring you to add a new .NET Framework version in your deployment package.

By default, when you upgrade Visual RPG 2005 projects to Visual Studio 2008, they continue to target .NET Framework 2.0. Optionally, you can switch the target from .NET Framework 2.0 to either .NET Framework 3.0 or .NET Framework 3.5, to take advantage of new features in those versions.

.NET Framework Versions

.NET Framework 2.0: Included in Visual Studio 2005.

Creating Multi-Targeted Projects

Creating a New Visual Studio 2008 project automatically targets the latest .NET Framework version (currently, .NET Framework 3.5) in order to provide all the newest features.

In the New Project dialog box for Visual RPG for Visual Studio 2008, the upper right corner will display .NET Framework 3.5.  Select the arrow to the right to display a drop-down box displaying .NET Framework 2.0 (VS 2005) and .NET Framework 3.0 (Vista).

Visual Studio 2008 displays only controls and other project items that are relevant to the current target .NET Framework version, so that you do not unintentionally add a new dependency to a later .NET Framework version by adding a new control to your project.

multitargeting

Resolving Assembly References and Changing Target Framework

The Add Reference dialog box disables system assemblies that do not pertain to your target .NET Framework version. (System assemblies are .dll files that are part of, or have a dependency on, a .NET Framework version.) This helps you avoid adding references to assemblies that are not in your target version. If you modify your project file to include references that belong to a .NET Framework version that is newer than the one currently targeted by your project, your reference will not resolve. Also, you cannot add or use controls that depend on this reference. You can resolve this reference by switching the .NET Framework target of your project to one that includes this reference. You can do this on the project's Property Page. For more information, see Project Properties - Application Page.

multitargeting property page

If you add a reference to a user-created assembly that directly or indirectly references system assemblies that belong to a newer .NET Framework version than the version currently targeted by your project, Visual Studio 2008 will display a warning. If you ignore this warning, make sure that your deployment project includes all required .NET Framework files.

See Also

Project Properties - Application Page