【问题标题】:error 0x80070005: Adding a tile failed with unexpected error running WACK on Jenkins错误 0x80070005:添加磁贴失败,在 Jenkins 上运行 WACK 时出现意外错误
【发布时间】:2017-01-21 00:41:50
【问题描述】:

尝试在未安装在执行 Windows 批处理命令的 Jenkins 会话中的应用程序上运行 appcert (WACK) 时,在此处出现“错误 0x80070005:添加磁贴失败并出现意外错误”。我编写了一个简单的 C# 包装器以在提升的用户模式下调用 appcert。 Wrapper 和基本命令行在 Jenkins 之外在一个未提升的 cmd 窗口中的同一个框中工作......挠头......

"C:\Program Files (x86)\Windows Kits\10\App Certification Kit\appcert.exe" reset

if %errorlevel% neq 0 exit /b %errorlevel%

"C:\Program Files (x86)\Windows Kits\10\App Certification Kit\appcert.exe" test -appxpackagepath %WORKSPACE%\UWP_0.9.%BUILD_NUMBER%.0_x86_x64_arm.appxbundle -reportoutputpath %WORKSPACE%\wack.xml

if %errorlevel% neq 0 exit /b %errorlevel%



16:32:04 Successfully reset the testing configuration.

16:32:11     Beginning execution of task Detect app type from package.

16:32:11     Task Detect app type from package execution result was success.

16:32:11     Note: Test application type - UapApp.

16:32:11     Beginning execution of task Extract files from package.

16:32:11     Beginning execution of task Performs AppX deployment/cleanup in the IDE scenario..

16:32:11     Task Extract files from package execution result was success.

16:32:11 Root "Trusted Root Certification Authorities"

16:32:11 Signature matches Public Key

16:32:11 Related Certificates:

16:32:11 

16:32:11 Exact match:

16:32:11 Element 7:

16:32:11 Serial Number: 1b659911670d2b9f436f7b922e12ed51

16:32:11 Issuer: CN=ED346674-0FA1-4272-85CE-3187C9C86E26

16:32:11  NotBefore: 1/10/2017 4:01 PM

16:32:11  NotAfter: 1/10/2018 10:01 PM

16:32:11 Subject: CN=ED346674-0FA1-4272-85CE-3187C9C86E26

16:32:11 Signature matches Public Key

16:32:11 Root Certificate: Subject matches Issuer

16:32:11 Cert Hash(sha1): 7a 5f 2f 31 7a 88 82 fd e5 12 f6 fb 2d 37 46 1f 29 ff 
01 ef

16:32:11 

16:32:11 Certificate "ED346674-0FA1-4272-85CE-3187C9C86E26" already in store.

16:32:11 CertUtil: -addstore command completed successfully.

16:32:11     Task Performs AppX deployment/cleanup in the IDE scenario. 
execution result was failure.

16:32:11 

16:32:11 error 0x80070005: Adding a tile failed with unexpected error.

【问题讨论】:

  • if %errorlevel% neq 0 exit /b %errorlevel% 可以替换为 if errorlevel 1 exit /B,它的作用完全相同,但速度更快。命令ifexit 不会更改先前命令/应用程序的当前错误级别(退出/返回代码)。 if errorlevel 1 表示 IF 上一个命令的退出代码大于或等于 1 THEN ...应用程序通常不会以负值退出。在命令提示符窗口 if /? 中运行并查看 Microsoft 支持文章 Testing for a Specific Error Level in Batch Files

标签: windows batch-file jenkins wack


【解决方案1】:

我自己无法验证,但很可能是下面缺少双引号的命令行是失败的原因。

"C:\Program Files (x86)\Windows Kits\10\App Certification Kit\appcert.exe" test -appxpackagepath %WORKSPACE%\UWP_0.9.%BUILD_NUMBER%.0_x86_x64_arm.appxbundle -reportoutputpath %WORKSPACE%\wack.xml

使用%WORKSPACE% 引用两次的环境变量WORKSPACE 的值包含当前Jenkins 作业的当前工作区文件夹的完整路径。

我想这个文件夹路径包含 1 个或多个空格,这需要将两个参数字符串用双引号括起来才能正确传递给 appcert.exe

对于这种情况,这个命令行肯定更好:

"%ProgramFiles(x86)%\Windows Kits\10\App Certification Kit\appcert.exe" test -appxpackagepath "%WORKSPACE%\UWP_0.9.%BUILD_NUMBER%.0_x86_x64_arm.appxbundle" -reportoutputpath "%WORKSPACE%\wack.xml"

但是,我使用我最喜欢的 www 搜索引擎通过非常简单快速的搜索发现页面 Error 0x80070005 with Windows App Certification Kit 以及许多其他页面,其中错误代码 0x80070005 字面意思是“拒绝访问”资源。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-25
    • 2019-01-14
    • 1970-01-01
    相关资源
    最近更新 更多