Error File 'MakePri.exe' not found

假如想象 提交于 2020-01-03 13:39:15

问题


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.


回答1:


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



回答2:


I had the same issue and I tried everything except reinstall Windows:

  • Repair VS2017
  • Install additional SDK
  • Reinstall SDK
  • Uninstall VS2017, install SDK, then install VS2017
  • Uninstall and reinstall VS2017 (in one step)

As mentioned by original poster:

  • WindowsSdkDir environment variable does not exist
  • MakePri.exe exists in the right path
  • Registry entries for Win10 SDK exist in WOW6432 node and point to correct folder.

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




回答3:


I was having this same problem.

what I solved was I copy an SDKManifest.xml file from the folder of my sdk that was installed in this path "D: \ Windows Kits \ 10"

just copy the SDKmanifest to the project root folder, and it worked normally!



来源:https://stackoverflow.com/questions/45353944/error-file-makepri-exe-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!