question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Microsoft.PythonTools.Uwp.targets" not found when creating IoT project due to custom VS install location

See original GitHub issue

I 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:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
cirokenzie1commented, Aug 16, 2017

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.

0reactions
Saibamencommented, Feb 22, 2019

MSBuildExtensionsPath32 system variable need to be set to C:\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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't load Visual Studio project due to missing Microsoft. ...
To install this, open up the Visual Studio Installer, select "Modify," open the "Individual components" tab, and search for "Python Web Support" ...
Read more >
Mapping of missing .targets files with Visual Studio workloads
When trying to build something using msbuild, and you get an error message saying the *.targets file could not be found, it would...
Read more >
4. Using Python on Windows — Python 3.11.4 documentation
This document aims to give an overview of Windows-specific behaviour you should know about when using Python on Microsoft Windows. Unlike most Unix...
Read more >
Developing foreground applications - Windows IoT
Visual Studio is the primary tool for writing UWP apps for IoT Core and in general. You can find a detailed listing of...
Read more >
Visual Studio 2022 version 17.0 Release Notes
Get the latest features, bug fixes, and support for Visual Studio 2022 version 17.0. Download today.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found