在构建UWP应用时如何解决Visual Studio 2017中的“ ValidateAppxManifest任务失败”错误?

时间:2019-08-25 12:59:35

标签: visual-studio visual-studio-2017

错误:

Severity    Code    Description Project File    Line    Suppression State
Error       The "ValidateAppxManifest" task failed unexpectedly.
System.BadImageFormatException: Retrieving the COM class factory for component with CLSID {5842A140-FF9F-4166-8F5C-62F5B7B0C781} failed due to the following error: 800700c1  is not a valid Win32 application. (Exception from HRESULT: 0x800700C1).
   at Microsoft.VisualStudio.ImmersiveProjectServices.Shared.AppxInterop.AppxInteropHelpers.GetAppxManifestReaderFromManifestPath(String manifestPath)
   at Microsoft.Build.AppxPackage.ValidateAppxManifest.SdkValidation()
   at Microsoft.Build.AppxPackage.ValidateAppxManifest.ExecuteImplementation()
   at Microsoft.Build.AppxPackage.AppxPackagingTaskHelper.Execute(String file)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Build.AppxPackage.AppxPackagingTaskHelper.Execute(String file)
   at Microsoft.Build.AppxPackage.ValidateAppxManifest.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() App3            

Severity    Code    Description Project File    Line    Suppression State
Error       Task 'ValidateAppxManifest' failed. Retrieving the COM class factory for component with CLSID {5842A140-FF9F-4166-8F5C-62F5B7B0C781} failed due to the following error: 800700c1  is not a valid Win32 application. (Exception from HRESULT: 0x800700C1).

输出:

1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(2638,5): error MSB4018:    at Microsoft.Build.AppxPackage.ValidateAppxManifest.Execute()
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(2638,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(2638,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========

Microsoft.AppxPackage.Targets文件位于第2638行:

<!-- The following target generates the appx package. -->
  <Target Name="_GenerateAppxPackageFile"
          Inputs="$(MSBuildAllProjects);@(FinalAppxManifest);@(AppxPackagePayload);$(PackageCertificateKeyFile)"
          Outputs="$(AppxPackageOutput)"
          Condition="'$(AppxPackagePipelineVersion)' == '$(StandardBuildPipeline)' or '$(BuildAppxSideloadPackageForUap)' == 'true'"
          DependsOnTargets="_FindAppxContentGroupMap">

    <ItemGroup Condition="'$(AppxPackageIncludePrivateSymbols)' != 'true'">
      <AppxPackagePayload Remove="@(AppxPackagePayload)" Condition="'%(Extension)' == '.pdb'" />
    </ItemGroup>

0 个答案:

没有答案