从VS 2005升级到VS 2010 Express时的C++项目兼容性问题

5
我收到了一些使用Visual Studio 2005版本构建的文件。
然而,当我尝试将.sln文件转换为VS 2010 Express C++中可用时,我遇到了问题。
错误提示显示了路径,并表示找不到该文件,尽管该文件确实存在。我知道除非我漏掉了什么,否则两者之间不应该有任何兼容性问题。是否有人遇到过这种类型的问题?
确切的错误消息如下:
“Conversion Report - GeoM\GeoM.vcproj: Converting project file 'C:\Users...\GeoM\GeoM.vcproj'。文件'C:\Users...\GeoM\GeoM.vcproj'未找到。项目升级失败。”

1
转换向导显示有关发生的错误的更多信息。发布更多信息。 - cprogrammer
我删除了C++标签,因为这是VC特定的,与C++语言无关。 - Mark B
1个回答

10
最可能的解释是,您的C++项目已经被配置为支持除x86之外的其他平台(例如x64或IA-64)的编译。
这在Visual C++博客中有解释,在Visual Studio 2010 C++ Project Upgrade Guide中提到:

Make sure you have the required platforms installed before doing upgrade

Converting a project on a machine without all the available platforms for the project will result in a conversion error. For example, if you try to convert a project with Itanium Platform on Visual Studio Professional SKU, which does not support the Itanium platform, you will see a conversion error like the following:

Failed to upgrade 'Debug|<Itanium>'. Please make sure you have the
corresponding platform installed under '%vctargetspath%\platforms\Itanium'.
Cannot load the project due to a corrupt project file. The following error
has occurred during XML parsing:

    File: D:\Sample\ConsoleApp\ConsoleApp.vcproj
    Line: 28
    Column: 5
    Error Message:
    System error: -2147154677.
    The file 'D:\Sample\ConsoleApp\ConsoleApp.vcproj' has failed to load.

This is by design as the conversion needs to evaluate the properties in the missing platforms to do a successful conversion. You can verify which platforms are installed on your machine by looking in the following directories: %ProgramFiles%\MSBuild\Microsoft.cpp\V4.0\Platforms (or %ProgramFiles(x86)%\MSBuild\Microsoft.cpp\V4.0\Platforms on x64 machine) for the Platforms installed on the machine.

由于Express版本不支持为这些平台编译C++应用程序,因此升级向导无法转换您的项目并返回所描述的错误消息。
唯一成功升级的方法是使用完整版Visual Studio(安装了适当的平台编译器工具),或编辑解决方案/项目文件以删除任何非x86配置的提及。您可以使用简单的文本编辑器如记事本来完成此操作,但要像往常一样先备份以防止丢失不可替代的内容。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接