700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > visual studio如何修改c++项目的.net framework框架版本

visual studio如何修改c++项目的.net framework框架版本

时间:2024-01-08 06:51:13

相关推荐

visual studio如何修改c++项目的.net framework框架版本

一、 修改项目文件

在 Visual Studio 的“解决方案资源管理器”中,打开项目的快捷菜单,然后选择“卸载项目”。这将为你的项目卸载项目文件 (.vcxproj)。

在菜单栏上,依次选择“文件”、“打开”、“文件”。在“打开文件”对话框中,导航到项目文件夹,然后打开项目文件 (.vcxproj)。

在项目文件中,找到目标 Framework 版本的条目。例如,如果你的项目设计为使用 .NET Framework 4.5,<PropertyGroupLabel="Globals">元素中找到请在<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>元素,如果<TargetFrameworkVersion>元素不存在,则新增之,并修改相应版本号。

二、修改.props文件,使工具集与.net框架匹配

Another thing I learned on the way is thatyou cannot mix valuesofPlatform ToolsetandTarget Framework Version.

The possible combinations I found where:

.NET 3.5 or less:

Platform Toolset:v90, which will useVisual Studio runtime binaries,TargetFrameworkVersion:v3.5(or less),In the preprocessor you can have_WIN32_WINNTdefined (e.g._WIN32_WINNT=0x0500)

.NET 4.0 or higher:

Platform Toolset:v100, which will useVisual Studio runtime binaries,TargetFrameworkVersion:v4.0(or higher),In the preprocessor youmust nothave the '_WIN32_WINNT=0x0500' defined

参见:

1./zh-cn/library/Ff770576.aspx

2./questions/18571546/clr-cli-linker-fails-with-error-lnk-custom-attributes-are-not-consistent

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。