In Visual Studio 2017, I am building Class Library(Portable) which targets both .Net 4.6 and Windows Universal Application 10.0. While building the application, below error is thrown.
Error File 'MakePri.exe' not found. See http://go.microsoft.com/fwlink/?LinkID=798187 for more information.
I have done the following
- Installed Latest Windows 10 SDK
- Repaired Visual Studio 2017
- Also in the environment variables, "WindowsSdkDir" is not available
- The path "C:\Program Files (x86)\Windows Kits\10\bin" exists and this file also available
I have used the following post to troubleshoot this issue. https://social.msdn.microsoft.com/Forums/en-US/8c752e9e-85df-4fee-8026-9b54b6e46be2/vs1517-error-appx1639-missing-file-makepriexe?forum=msbuild
But still there is no luck.
I encountered same problem and after bugging me for a few days i finally managed to fix it. From build logs I saw that VS is not able to find makepri.exe file. In Microsoft.AppXPackage.Targets file variable MakePriExeFullPath is used, so I added new environment variable for my system with that name. For value, i pointed it to the makepri.exe in windows 10 SDK folder, which is on my machine in:
C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x64\MakePri.exe
I had the same issue and I tried everything except reinstall Windows:
As mentioned by original poster:
After a lot of hair pulling I fired up ProcMon (SysInternals) and run a build from VS. I noticed that MSBuild was looking for SDKManifest.xml in every SDK root folder, but that file did not exist in the Win10 SDK root folder.
I copied SDKManifest.xml from another PC with the same Win10 SDK version installed that did not have the issue and it worked.
It is beyond me why after uninstalling everything and installing from scratch, SDKManifest.xml was still missing.
PS: I have many SDKs installed (7.0 through 10.0) most of which were installed with the corresponding VS version. I run VS2008 (Pro), VS2013 (Ent), VS2015 (Ent) and VS2017 (Community) side by side for different projects (some projects, especially SSIS, cannot be migrated to VS2017 without an upgrade to the database engine version). I also have WDK installed for a printer driver development, so all this may be confusing the SDK/VS installer.
Edit: I would be reluctant to alter VS *.target files or add any environment variables and point them to a hard coded path. This will almost certainly break any future SDK installation and does not allow side by side usage of multiple SDK versions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With