我正在尝试构建一个 Windows Phone 8 项目,其中包含对用 C++ 编写的 WinRT 组件项目的引用。该项目从 VS2012 IDE 构建,但不使用 MSBuild (c:\Windows\Microsoft.Net\Framework\v4.0.30319\MSBuild.exe) 从命令行构建。它抛出此错误:
WindowsPhoneRuntimeComponent1\WindowsPhoneRuntimeComponent1.vcxproj(185,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\WindowsPhone\v7.0\Microsoft.Cpp.WindowsPhone.7.0.targets" was not found. Confirm that
the path in the <Import> declaration is correct, and that the file exists on disk.
根据所需的目标文件判断,我的假设是它尝试为 WP7 构建 WP8 项目。有谁知道如何解决这个问题,或者是否有可能解决这个问题?
最佳答案
您需要将项目更改为 WP8。右键单击您的项目,选择属性。在“应用程序”选项卡下,将类型从 WP7 更改为 WP8。希望有效。
关于msbuild - 从命令行使用 C++ WinRT 组件构建 Windows Phone 8 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13454847/