3
votes

I am trying to build a Windows Phone 8 project which contains a reference to a WinRT component project written in C++. The project builds from VS2012 IDE but doesn't build from the command line using the MSBuild (c:\Windows\Microsoft.Net\Framework\v4.0.30319\MSBuild.exe). It throws this error:

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.

My assumption judging on the required target file is that it tries to build a WP8 project for WP7. Does anyone know how to work around this issue, or if there is a possible solution to this problem?

1
Post the full msbuild command line you attempted. If you're attempting to build by a solution file, for a upgraded WP7 project, you most likely have the wrong .NET version referenced.Claus Jørgensen

1 Answers

1
votes

You need to change your project to WP8. Right click on your project, choose Properties. Under the Application tab change the type from WP7 to WP8. Hope that works.