Change Target-Framework in C++/CLI for VS2010/2012

It is still not possible to change the target framework in the VS2010 or VS2012 IDE in the project settings.
The only way to change it, is to manually edit the vcxproj file. For this you need to do the following:

  1. Right-click on the projectin Solution Explorer and select “Unload project”
  2. The again do a right-click on the unloaded project in the Solution Explorer and select “Edit .vcxproj”
  3. In the porject XML file search for the node
  4. In this node, find the sub node (if it does not exists, you must add one)
  5. The inner text of this node defines the target framework version. It can be one of the following values: v2.0,v3.0, v3.5 v4.0 (VS2010 and 2012) or v4.5 (only VS2012)
  6. Save the vcxproj Datei and close it
  7. The again do a right-click on the unloaded project in the Solution Explorer and select “Reload Project”

Example:

  <PropertyGroup Label="Globals">
    <ProjectGuid>{089A9EBF-5149-462A-BC7E-2B1B59DE123C}</ProjectGuid>
    <Keyword>Win32Proj</Keyword>
    <RootNamespace>CPP_VS2010</RootNamespace>
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
  </PropertyGroup>

One thought on “Change Target-Framework in C++/CLI for VS2010/2012

Leave a Reply

Your email address will not be published. Required fields are marked *

Captcha *