更改C ++ / CLI项目到另一个框架比4.0与VS2010 [英] Change C++/CLI project to another framework than 4.0 with vs2010

查看:279
本文介绍了更改C ++ / CLI项目到另一个框架比4.0与VS2010的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于我我的项目升级到Visual Studio 2010中的项目格式,我的C ++ / CLI项目的目标是到.NET框架4.0。

Since I upgraded my project to visual studio 2010 project format, my C++/CLI project is targeted to .net framework 4.0.

这是很容易的框架版本切换到另一个版本,从C#项目,但我不知道如何做到这一点的C ++ / CLI的项目,我看到在项目属性页没有设置这一点。

It is easy to switch the framework version to another version from a C# project, but I have no clue how to do this in a C++/CLI project, I see no setting for this in the project property pages.

推荐答案

这说明,当您在框架和引用对话框preSS F1:

This shows up when you press F1 in the Framework and References dialog:

默认情况下为新项目,目标框架设置为.NET Framework 4中的IDE不支持修改目标框架,但您可以手动更改。 在项目文件(.vcxproj),默认的目标框架是重新由V4.0属性元素psented $ P $。要改变目标框架,卸载该项目,使用文本编辑器打开该项目文件,然后从V4.0更改属性元素的值到安装在服务器上的另一个版本。例如,如果指定V3.5,从而重新presents在.NET Framework v3.5版本,的Visual Studio 2008 SP1必须安装。保存并关闭文件,重新加载项目,并确认目标的框架,显示在属性页。

By default for new projects, the targeted framework is set to .NET Framework 4. The IDE does not support modifying the targeted framework, but you can change it manually. In the project file (.vcxproj), the default targeted framework is represented by the v4.0 property element. To change the targeted framework, unload the project, use a text editor to open the project file, and then change the value of the property element from v4.0 to another version that is installed on your server. For example, if you specify v3.5, which represents the .NET Framework v3.5, Visual Studio 2008 SP1 must be installed. Save and close the file, reload the project, and verify that the targeted framework is displayed in the property page.

这是不是非常准确的改装项目,你就必须添加< TargetFrameworkVersion> 元素自己。把它放在标有全局的的PropertyGroup:

That's not terribly accurate on converted projects, you'll have to add the <TargetFrameworkVersion> element yourself. Put it in the PropertyGroup labeled "Globals":

  <PropertyGroup Label="Globals">
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    <others...>
  </PropertyGroup>

这篇关于更改C ++ / CLI项目到另一个框架比4.0与VS2010的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆