我有一個Windows Phone 8 C#項目和Windows Phone 8 C++庫的Visual Studio 2012解決方案。我把它移到了另一臺電腦上。現在,當我嘗試打開該解決方案,庫項目失敗,並在控制檯下面的消息加載:每個項目在哪裏TargetPlatformVersion?
MyLib.vcxproj : error : Unable to read the project file "MyLib.vcxproj".
MyLib.vcxproj(620,3): 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.
當我看着到項目文件中,我發現上線以下620:
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsPhone\v$(TargetPlatformVersion)\Microsoft.Cpp.WindowsPhone.$(TargetPlatformVersion).targets" />
所以它看起來像環境變量TargetPlatformVersion
的價值有點關閉。
然後我在這臺機器上創建了另一個解決方案,也是C#/ C++組合。那個打開並編譯和運行,nae問題。查看新創建的庫中的項目文件,它在末尾具有相同的<Import>
行。
現在,解決方案複製可能並不完美。我沒有複製所有文件 - 我認爲是相關的 - .sln,.vcxproj,但不是.sdf而不是.suo。
它看起來像缺少某些東西 - 在解決方案或項目級別上定義值TargetPlatformVersion
的文件未被複制,現在Visual Studio正在挑選錯誤的默認值。不用說,WP7.0與它無關,都是WP8。
任何想法在哪裏可以設置此設置?在項目和解決方案中都沒有提及TargetPlatformVersion。
' WindowsPhone71 TargetFrameworkProfile>'是否設置正確? –
Hades32
這是一個本地項目 - 沒有目標框架。我能找到的最接近的是 v110_wp80 PlatformToolset>。 –