面向.NET 3.5的C ++ / CLI在Visual Studio 2010 Beta 2中CLI、NET、Visual、Beta

2023-09-03 02:57:59 作者:痞子配酒

有没有人有任何成功的一个VS 2008的C ++ / CLI(vcproj)项目转换为VS 2010项目(vcxproj),同时保持.NET 3.5作为目标框架?我一直没能做到这一点,并获得该项目建设顺利。该项目编译正常在VS2008的.NET 3.5和罚款VS2010的.NET 4.0,但我无法针对.NET 3.5在2010年的IDE似乎并没有为它提供一个选项,修改vcxproj文件通过添加

Has anyone had any success converting a VS 2008 C++/CLI (vcproj) project to a VS 2010 project (vcxproj), whilst maintaining .NET 3.5 as the target framework? I haven't been able to do this and get the project to build successfully. The project compiles fine in VS2008 as .NET 3.5, and fine in VS2010 as .NET 4.0, but I am unable to target .NET 3.5 in 2010. The IDE doesn't seem to provide an option for it, and modifying the vcxproj file by adding

<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>

将导致编译失败与folling错误:

causes compilation to fail with the folling error:

Error   1   error C1001: An internal error has occurred in the compiler.

据这个链接,没有在VS2008和2010年间使用的编译器显然有些分歧,但手工编辑项目文件仍然建议作为解决方案。没有人有任何的想法对吗?

According to this link, there is apparently some differences in compilers used between VS2008 and 2010, but manually editing the project file was still suggested as a solution. Does anyone have any idea on this?

推荐答案

感谢您对TargetFrameworkVersion小费。它为我工作,但遗憾的是并不能帮助你。

Thanks for the tip on TargetFrameworkVersion. It worked for me, but this unfortunately does not help you.

这是很容易得到内部编译器错误,如果你有另一个版本的C ++编译器周围地势作了一些旧文件(PCH文件,目标文件)。你有没有清理一切,当 你改工具的版本?

It is easy to get "internal compiler error" if you have some old files (PCH files, object files) made for another version of the C++ compiler lying around. Have you cleaned everything when you changed tools version?