Geeks With Blogs
Igor Milovanović .NET, cats and more...

 

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

Posted on Monday, August 27, 2012 12:45 PM .NET | Back to top


Comments on this post: Visual Studio 2012 - Setting the target framework in C++ Projects

# re: Visual Studio 2012 - Setting the target framework in C++ Projects
Requesting Gravatar...
I tried this, but I've got an error:
Error 20 error LNK2022: metadata operation failed (80131195) : Custom attributes are not consistent: (0x0c0001e7).
Left by A on Jan 13, 2013 11:36 AM

# re: Visual Studio 2012 - Setting the target framework in C++ Projects
Requesting Gravatar...

I've hit exactly the same thing, save it's not custom attributes. It's a couple of methods & a couple of fields.
Left by Larry Hunsucker on Jul 25, 2014 3:41 AM

Your comment:
 (will show your gravatar)


Copyright © Igor Milovanovic | Powered by: GeeksWithBlogs.net