简体   繁体   English

“ValidateAppxPackage”任务意外失败

[英]The “ValidateAppxPackage” task failed unexpectedly

While creating my export for Windows Store I am having this issue. 在为Windows应用商店创建导出时,我遇到了这个问题。

Simple export works fine but when I try to create a build for windows store I am having this error: 简单导出工作正常,但当我尝试为Windows商店创建一个版本时,我遇到此错误:

The "ValidateAppxPackage" task failed unexpectedly.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Build.AppxPackage.ValidateAppxPackage.<>c.<CheckThatLanguagesAreSupported>b__85_0(XElement resource)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at Microsoft.Build.AppxPackage.ValidateAppxPackage.CheckThatLanguagesAreSupported()
   at Microsoft.Build.AppxPackage.ValidateAppxPackage.ExecuteImplementation()
   at Microsoft.Build.AppxPackage.AppxPackagingTaskHelper.Execute()
   at Microsoft.Build.AppxPackage.ValidateAppxPackage.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() SeedRateCalculator      

I don't know what to do. 我不知道该怎么办。 I am using VS 2015 and creating build of my Universal Windows App . 我正在使用VS 2015并创建我的通用Windows应用程序的构建。

On msdn some people solved the problem in this way: 在msdn上,有些人以这种方式解决了这个问题:

  • I fixed the problem by deleting the StoreAssociation file, making it rebuild it. 我通过删除StoreAssociation文件修复了问题,使其重建。 Thanks! 谢谢!

  • I decided to move the app folder to another location, and ran Visual Studio in admin mode (with admin privileges) and it started working 我决定将app文件夹移动到另一个位置,然后以管理员模式运行Visual Studio(具有管理员权限)并开始工作

Let me know! 让我知道!

I normally delete my obj and bin folder before try to pack things up, I used to run into all sorts of trouble, also do a "Clean solution" just for good measure (Right click solution => Clean solution). 我通常在尝试打包之前删除我的obj和bin文件夹,我曾经遇到过各种各样的麻烦,也做了一个“清洁解决方案”,只是为了好的措施(右键点击解决方案=>清洁解决方案)。

If the problem still persists then delete the Package.StoreAssociation.xml and [your_app_name]_StoreKey.pfx then associate with store again (Right click on project => Store => Associate ...) and then try to package it. 如果问题仍然存在,则删除Package.StoreAssociation.xml和[your_app_name] _StoreKey.pfx,然后再次与store关联(右键单击project => Store => Associate ...),然后尝试打包它。

Should be straight forward. 应该是直截了当的。

I'm getting the same problem on an App that has been in the store for years , I just fixed a bug, built new packages, run verification on VS2017 and I get this on the Bytecode generation tests, and so all subsequent tests also fail. 在商店里已经存在多年应用程序遇到了同样的问题,我刚刚修复了一个错误,构建了新的软件包,在VS2017上运行验证,我在Bytecode生成测试中得到了这个,因此所有后续测试也都失败了。 So I deleted Package.StoreAssociation.xml and tried to re-associate the app with the store, but when I did that it did not create a new Package.StoreAssociation.xml. 所以我删除了Package.StoreAssociation.xml并尝试将应用程序与商店重新关联,但是当我这样做时,它没有创建新的Package.StoreAssociation.xml。 So I had to restore the old Package.StoreAssociation.xml, then re-associate the app with the store, and I see a bunch of updates, so clearly this needs to happen - seems broken that this didn't happen automatically when I created my store packages the first time. 所以我不得不恢复旧的Package.StoreAssociation.xml,然后将应用程序与商店重新关联,我看到了一堆更新,所以很明显这需要发生 - 似乎打破了我创建时不会自动发生我的商店第一次打包。 But this also didn't solve the problem, I still get this when trying to verify the app: 但这也没有解决问题,我仍然在尝试验证应用程序时得到这个:

Bytecode generation

Error Found: The bytecode generation test detected the following errors: System.NullReferenceException: Object reference not set to an instance of an object. 发现错误:字节码生成测试检测到以下错误:System.NullReferenceException:未将对象引用设置为对象的实例。 at Microsoft.Windows.SoftwareLogo.Tests.Utility.IsPackageWWA(AppXPackage package) at Microsoft.Windows.SoftwareLogo.Tests.BytecodeGenerationCheck.BytecodeGenerationCheck.ExecuteSharedValidation(String manifestFilePath, String packageFullName) at Microsoft.Windows.SoftwareLogo.TestBase.TestBase.ExecuteTest() Microsoft.Windows.SoftwareLogo.TestBase.TestBase.ExecuteTest上的Microsoft.Windows.SoftwareLogo.Tests.Utility.IsPackageWWA(AppXPackage包),Microsoft.Windows.SoftwareLogo.Tests.BytecodeGenerationCheck.BytecodeGenerationCheck.ExecuteSharedValidation(String manifestFilePath,String packageFullName)at Microsoft.Windows.SoftwareLogo.TestBase.TestBase.ExecuteTest( )

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM