"Microsoft.PythonTools.Uwp.targets" not found when creating IoT project due to custom VS install location
See original GitHub issueI am currently trying to follow the guide here to create a new Windows IoT Core / UWP project for Python. After installing PTVS and the IoT-specific components, I am unable to create the project due to the following error (displayed in a message box):
The imported project “C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Python Tools for Visual Studio - UWP\2.2\Microsoft.PythonTools.Uwp.targets” was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
C:\Users\<username>\AppData\Local\Temp\<string of letters>\Temp\TestBackgroundIoTApp.pyproj
After a bit of investigation, it seems that this is caused by the fact that Visual Studio is installed on my secondary drive (D:
) instead of C:
. The directory mentioned in the error message does not exist, however the equivalent path does exist on my D:
drive. What do I need to change in my set-up to make this work as a temporary measure, and what must be changed to get a permanent fix?
I am not completely sure that this is an error produced by PTVS; it may actually be the IoT extension that is to blame. However, from reading through the related bits in this repo it seems like this is more likely to be the cause (or at least in a position to fix it).
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
If this helps anyone.
I had the same problem even tho my VS was installed in the proper directory, VS was not able to load the solution. It kept on saying Microsoft.PythonTools.Uwp.targets" missing. After lot of headbanging I noticed that while installation of PTVS for visual studio 2017, checkbox for python IoT support was unchecked. Checking that solved my problem of loading it onto VS.
MSBuildExtensionsPath32
system variable need to be set toC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild
. Bug: https://developercommunity.visualstudio.com/content/problem/465815/msbuildextensionspath32-is-not-added-to-system-var.html