Visual Studio 2012 - Setting the target framework in C++ Projects

Posted by Igor Milovanovic on Geeks with Blogs See other posts from Geeks with Blogs or by Igor Milovanovic
Published on Mon, 27 Aug 2012 10:45:34 GMT Indexed on 2012/08/27 21:40 UTC
Read the original article Hit count: 411

Filed under:

 

The Visual Studio 2012 doesn’t have a UI to set the Target Framework in C++ Projects.  

 v40

Target Framework : 4.0

 

The online documentation does say to edit the .vcxproj project and change the TargetFrameworkVersion Tag.

However, The C++ projects don’t have that tag by default. They just assume that the target framework is v4.0.

 

Instead, you have to add the TargetFrameworkVersion-Tag to the PropertyGroup Globals.

 

   1:  <PropertyGroup Label="Globals">
   2:      ...
   3:      <RootNamespace>...</RootNamespace>
   4:      <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
   5:  </PropertyGroup>

 

When you reload the project, the target framework version in your project will be changed.

v45

Target Framework : 4.5

 

[1] How to: Modify the Target Framework and Platform Toolset http://msdn.microsoft.com/en-us/library/ff770576.aspx

© Geeks with Blogs or respective owner