【问题标题】:Installation of UWP app fails with error 0x80070005: Adding a tile failed with unexpected errorUWP 应用安装失败并出现错误 0x80070005:添加磁贴失败并出现意外错误
【发布时间】:2017-02-08 12:52:41
【问题描述】:

我正在尝试使用 powershell 命令安装 UWP 应用程序

Start-Process powershell "-ExecutionPolicy Unrestricted -NoExit -Command "cd \"C:\Users\Administrator\Documents\Visual Studio 2015\Projects\App3\AppPackages\App3\App3_1.0.0.0_x64_Test`"; & @ 987654322@ -Force`" |Out-File C:\Users\Administrator\Desktop\log.txt" -Verb RunAs -Wait

其中 AppDevPackage.ps1 是应用程序中提供的 powershell 脚本。

当我使用右键单击运行脚本时脚本运行良好 -> 使用 powershell 运行。但是当我尝试使用 jenkins 或使用计划任务调用脚本时,会引发以下错误:

Add-AppxPackage:部署失败,HRESULT:0x80073CF6,无法注册包。

错误 0x80070005:添加磁贴失败,出现意外错误。

注意:有关更多信息,请在 [ActivityId] 5e8c5432-8277-0004-c28f-8c5e7782d201 中查找 事件日志或使用命令行 Get-AppxLog -ActivityID 5e8c5432-8277-0004-c28f-8c5e7782d201

在 C:\Users\Administrator\Documents\Visual Studio 2015\Projects\App3\AppPackages\App3\App3_1.0.0.0_x64_Test\Add-AppDevPackage.ps1:388 字符:13 + 添加-AppxPackage -Path $DeveloperPackagePath.FullName -Dep ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~ + CategoryInfo : WriteError: (C:\Users\Admini....0.0.0_x64.appx:String) [Add-AppxPac 影],IOException + FullyQualifiedErrorId:部署错误,Microsoft.Windows.Appx.PackageManager.Commands.AddA ppxPackageCommand

我也查看了事件日志,即使给出了相同的错误代码。我需要运行此脚本以实现自动化,因此无法手动运行。

【问题讨论】:

  • [ComponentModel.Win32Exception]0x80070005 报告这个错误意味着Access Denied
  • 我在使用右键单击运行它时没有收到此错误->作为 powershell 脚本运行。另外,我在自动化中使用提升的 powershell 窗口来运行此命令,所以不明白为什么会出现此错误。
  • 您在系统上的权限与以自动化方式运行脚本的用户权限有所不同。您可能需要提供明确的凭据才能在 jenkins 下运行或作为计划任务运行。

标签: powershell uwp appx


【解决方案1】:

我尝试了各种方法,但为 powershell 脚本配置了一个计划任务并使用以下命令从 jenkins 调用它:

schtasks /run /tn

是唯一对我有用的东西。

还要确保使用具有管理权限的用户帐户以最高权限运行计划任务。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-08-28
    • 1970-01-01
    • 1970-01-01
    • 2016-11-08
    • 1970-01-01
    • 2014-06-01
    • 1970-01-01
    • 2021-07-31
    相关资源
    最近更新 更多