Windows 8.1 Store app MAKEPRI build error

与世无争的帅哥 提交于 2019-12-11 11:08:34

问题


I keep getting the following two errors while building any newly created project, or old for Windows Store projects with Visual Studio 2013

Error   1   Initializing Indexer    c:\Temp\App4\App4\MakePri   App4
Error   2   Schema Validation Failed. The attribute 'targetOsVersion' on the element 'resources' is not defined in the DTD/Schema.  c:\Temp\App4\App4\MakePRI   App4

Turning the MSBuild project build output verbosity to Diagnostic I see the following

2>Using "GenerateProjectPriFile" task from assembly "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\Microsoft.Build.AppxPackage.dll".
2>Task "GenerateProjectPriFile" (TaskId:159)
2>  Task Parameter:MakePriExeFullPath=C:\Program Files (x86)\Windows Kits\8.0\bin\x64\MakePri.exe (TaskId:159)
2>  Task Parameter:PriConfigXmlPath=obj\Debug\priconfig.xml (TaskId:159)
2>  Task Parameter:
2>      IndexFilesForQualifiersCollection=
2>          obj\Debug\layout.resfiles
2>          obj\Debug\resources.resfiles (TaskId:159)
2>  Task Parameter:ProjectPriIndexName=b3cbc7ac-25e8-4dda-a091-231a51997222 (TaskId:159)
2>  Task Parameter:InsertReverseMap=False (TaskId:159)
2>  Task Parameter:ProjectDirectory=C:\@Personal\Projects\Squeezy2\Squeezy\Squeezy\ (TaskId:159)
2>  Task Parameter:OutputFileName=C:\@Personal\Projects\Squeezy2\Squeezy\Squeezy\bin\Debug\resources.pri (TaskId:159)
2>  Task Parameter:QualifiersPath=obj\Debug\qualifiers.txt (TaskId:159)
2>  Task Parameter:IntermediateExtension=.intermediate (TaskId:159)
2>  Task Parameter:MultipleQualifiersPerDimensionFoundPath=obj\Debug\MultipleQualifiersPerDimensionFound.txt (TaskId:159)
2>  C:\Program Files (x86)\Windows Kits\8.0\bin\x64\MakePri.exe New -ProjectRoot "C:\@Personal\Projects\Squeezy2\Squeezy\Squeezy\\" -ConfigXml obj\Debug\priconfig.xml -OutputFile "C:\@Personal\Projects\Squeezy2\Squeezy\Squeezy\bin\Debug\resources.pri" -IndexName b3cbc7ac-25e8-4dda-a091-231a51997222 -Verbose -Overwrite   (TaskId:159)
2>  Option Verbose specified (TaskId:159)
2>  Option Overwrite specified (TaskId:159)
2>MakePri : error 0x80004005: Initializing Indexer
2>MakePRI : error 0xdef00501: Schema Validation Failed. The attribute 'targetOsVersion' on the element 'resources' is not defined in the DTD/Schema.

Any idea how to fix that?


回答1:


I had to set VS2013 Tools > Options > Projects and Solutions > Build and Run > MSBuild project build output verbosity to Diagnostic

Then I realized this

1> Task Parameter:MakePriExeFullPath=C:\Program Files (x86)\Windows Kits\8.0\bin\x64\MakePri.exe (TaskId:86)

So it was using the wrong version of the SDK. Then talking to Tim Heuer he told me that "The devs are telling me that this is because the SDK path is messed up and can be caused if you are opening VS from a VS2012 command prompt perhaps."

That was it because I started VS2013 from powershell which was settings in my powershell profile the Visual Studio 2012 command prompt variables. When I changed it to Vs2013 everythign started to work correctly again!

Thanks Tim and the devs team!




回答2:


I had a similar problem when I invoked a Gradle script I had made from the VS2012 developer command prompt trying to build a Windows 8.1 app.

One of the build scripts I inherited contained an invocation of vcvarsall.bat which led me to wonder if that would help me. In fact it did, so I made a small batch script to do that and invoke Gradle all in one:

:: build_winstore.bat - Build for Windows Store.
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat
scripts\build\gradlew.bat %1 %2 %3 %4 %5 %6 %7 %8 %9

Inside my build.gradle is a task that invokes MSBuild.exe.

It is a little bit clunky, perhaps, but it allows me to run my build from the 2012 developer command prompt (which is the default thing that runs when I type cmd).



来源:https://stackoverflow.com/questions/21721621/windows-8-1-store-app-makepri-build-error

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