0

Getting "error 0x80070005: Adding a tile failed with unexpected error" here while trying to run appcert (WACK) on an application that is NOT installed within a Jenkins session executing a Windows batch command. I've written a simple C# wrapper to call appcert in elevated user mode. Wrapper and basic command line work outside of Jenkins on the same box in an unelevated cmd window... scratching head...

"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.
Ross Ridge
  • 38,414
  • 7
  • 81
  • 112
  • `if %errorlevel% neq 0 exit /b %errorlevel%` can be replaced by `if errorlevel 1 exit /B` which does exactly the same, but a little bit faster. The commands `if` and `exit` do not change current errorlevel (exit/return code) of previous command/application. `if errorlevel 1` means __IF__ exit code of previous command is greater or equal 1 __THEN__ ... Applications usually do not exit with a negative value. Run in a command prompt window `if /?` and see Microsoft support article [Testing for a Specific Error Level in Batch Files](https://support.microsoft.com/en-us/kb/69576). – Mofi Jan 21 '17 at 19:13

1 Answers1

0

I can't verify it by myself, but most likely the command line below with missing double quotes is the reason for the failure.

"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

The value of environment variable WORKSPACE referenced twice with %WORKSPACE% contains the full path to current workspace folder of the current Jenkins job.

And I suppose this folder path contains 1 or more spaces which requires enclosing both parameter strings in double quotes to be correct passed to appcert.exe.

For that case this command line is definitely better:

"%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"

However, I found with a very simple and quick search with my favorite www search engine the page Error 0x80070005 with Windows App Certification Kit among many others where it is written that error code 0x80070005 literally means "Access Denied" on a resource.

Mofi
  • 46,139
  • 17
  • 80
  • 143