title: UWP : SignTool Error: Access is denied. ( Resolve ! )
body: <p>This is re-Question about issue "SignTool Error: Access is denied." on my visual studio. </p>
  
  <p>When I compile "SideLoad" application on Visual Studio 2017. This error happened again. </p>
  
  <p>This is not first time for me. Previously, I could not resolve this error. Then, I bought New DELL PC :(  Yes, During some period, It worked fine without any problem. but I saw same error again, Today !</p>
  
  <p><strong>Here is some additional information.</strong></p>
  
  <ol>
  <li>x64, Windows 10, Os ver 1703 , Build 15063.675.</li>
  <li>Visual Studio 2017 </li>
  <li>This is new PC. Administrator, Local user, not MSN user.</li>
  <li>Target version : Windows 10 Creator Update ( 10.0; Build 15063 )</li>
  <li>Min version : Windows 10 November Update ( 10.0; Build 10586 )</li>
  </ol>
  
  <p>After build of side load applicaiton, This error show ::</p>
  
  <pre><code>1&gt;  Bg7Uwp1 -&gt; D:\develop\visualstudio2\xxx\Bg7Uwp1\Bg7Uwp1\bin\x86\Release\Bg7Uwp1.exe                                                                                                                                                                                                                                             
  1&gt;  Processing application code                                                                                                                                                                                                                                                                                                     
  1&gt;  Computing application closure and generating interop code                                                                                                                                                                                                                                                                       
  1&gt;    Loading 108 modules...                                                                                                                                                                                                                                                                                                        
  1&gt;    Generating code...                                                                                                                                                                                                                                                                                                            
  1&gt;    Interop code generated.                                                                                                                                                                                                                                                                                                       
  1&gt;  Generating serialization code                                                                                                                                                                                                                                                                                                   
  1&gt;  Compiling interop code                                                                                                                                                                                                                                                                                                          
  1&gt;  Generating System.Reflection.DispatchProxy proxy code.                                                                                                                                                                                                                                                                          
  1&gt;  Cleaning up unreferenced code                                                                                                                                                                                                                                                                                                   
  1&gt;  Generating native code                                                                                                                                                                                                                                                                                                          
  1&gt;  Generating fixups for native code                                                                                                                                                                                                                                                                                               
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(3787,5): error APPX1204: Failed to sign 'D:\develop\visualstudio2\xxx\Bg7Uwp1\Bg7Uwp1\bin\x86\Release\Bg7Uwp1_1.0.9.0_x86.appx'. SignTool Error: Access is denied.                
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(3787,5): error APPX1204: SignTool Error: An error occurred while attempting to sign: D:\develop\visualstudio2\xxx\Bg7Uwp1\Bg7Uwp1\bin\x86\Release\Bg7Uwp1_1.0.9.0_x86.appx        
  1&gt;                                                                                                                                                                                                                                                                                                                                  
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(3787,5): error APPX1204:                                                                                                                                                          
  ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========                                                                                                                                                                                                                                                         
  ========== Package: 0 succeeded, 2 failed ===========                                                                                                                                                                                                                                                                               
  ========== App Bundle: 0 succeeded, 1 failed ===========                                                                                                                                                                                                                                                                            
  </code></pre>
  
  <p>Please give me some idea. I tried everything from internet and here. but Previously, I could not resolve.. I can not buy new PC again !</p>
  
  <p><a href="https://i.stack.imgur.com/Uhu2U.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Uhu2U.png" alt="enter image description here"></a></p>
  
  <p><strong>Update 1</strong></p>
  
  <p>and After this trouble, I open new Uwp project and start sideload compile. it show same error ! This is same situation with previous PC ! Now, My Vs2017 can not make sideload for an 
   empty UWP project !!</p>
  
  <p>in previous PC, I tried everything. Re-install VS2017, Re-install NuGet items. but it did not resolve at all. Only way was to buy new PC and re-install VS.</p>
  
  <p><strong>Update 2</strong></p>
  
  <p>With verbose mode of VS2017 compile output, I found , There is signtool.exe in SignAppxPackageExeFullPath=C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x64\signtool.exe</p>
  
  <p>with it, I tried to sign by myself.</p>
  
  <ol>
  <li>Open command prompt tool with Admin</li>
  <li>Run below command. I success to sign !?? </li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/bhLYp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bhLYp.png" alt="enter image description here"></a></p>
  
  <p><strong>Update 3</strong></p>
  
  <p>Next challenge is to add "Admin privilege" with "Signtool.exe" like this. but this was failed. Error was changed. "It need administrator privilege" and it make build error. not success.</p>
  
  <p><a href="https://i.stack.imgur.com/YPcu6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YPcu6.png" alt="enter image description here"></a></p>
  
  <p><strong>Question</strong></p>
  
  <p>If I do sign manually, Is it enough ? </p>
  
  <ol>
  <li><p>I signed with manual  ( target file is : Bg7Uwp1_1.0.19.0_x64.appx )   "c:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x64\signtool.exe" sign /fd SHA256 /a /f Bg7Uwp1_TemporaryKey.pfx bin\x64\Release\Bg7Uwp1_1.0.19.0_x64.appx
  Done Adding Additional Store
  Successfully signed: bin\x64\Release\Bg7Uwp1_1.0.19.0_x64.appx</p></li>
  <li><p>I copy all "Release" folder to other PC.</p></li>
  <li>I copy "Bg7Uwp1_TemporaryKey.pfx" to other PC too.</li>
  <li>On 2nd PC, I install the certification key first "Bg7Uwp1_TemporaryKey.pfx". Success.</li>
  <li>I tried to install with clicking Bg7Uwp1_1.0.19.0_x64.appx</li>
  <li><p>I can not installed : (</p>
  
  <blockquote>
    <blockquote>
      <p>Either you need a new certificate installed for this app package, or you need a new app package with trusted certificates. Your system administrator or the app developer can help. A certificate chain processed, but terminated in a root certificate which isn't trusted (0x800B0109)</p>
    </blockquote>
  </blockquote></li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/xX2a5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xX2a5.png" alt="enter image description here"></a></p>
  
  <p><strong>Find! a solution but Not perfect yet.</strong></p>
  
  <p>with above error, <a href="https://wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/14080380-add-appxpackage-hresult-0x800b0109-root-certific" rel="nofollow noreferrer">I read this.</a>. This is a step to install sideload application to PC. I follow this. I can resolve the error 0x800B0109.</p>
  
  <ol start="2">
  <li>In File Explorer, right-click on the app package, and in the pop-up context menu select Properties.</li>
  <li>In the Properties dialog, select the Digital Signatures tab.</li>
  <li>In the Signature list, select the signature and then click the Details button.</li>
  <li>In the Digital Signature Details dialog, click the View Certificate button.</li>
  <li>In the Certificate dialog, click the Install Certificate… button.</li>
  <li>In the Certificate Import Wizard, select Local Machine and then click Next. You will need to grant administrator privileges to continue.</li>
  <li>Select Place all certificates in the following store and browse to the Trusted People store.</li>
  <li>Click Next, then click Finish to complete the wizard.</li>
  </ol>
  
  <p>after this step, I can install my Sideload to my Own PC. but To install 2nd PC has error. ( New error  <a href="https://social.technet.microsoft.com/Forums/windows/en-US/188cf10b-2b49-4695-ba0c-2fcc46977972/addappxpackage-deployment-failed-with-hresult-0x80073cf3-package-failed-updates?forum=w8itproinstall" rel="nofollow noreferrer">0x80073CF3</a> ) . but I get big improvement !</p>
  
  <p><strong>Update 4 ( Not resolve still ! )</strong></p>
  
  <p>Now, TO install other PC is not impossibile. Dependencies file can not create by VS. because signtool has error.I have to install other PC. Without it, All my time would be waste.. :( please help me...</p>
  
  <p>This is old dependencies files. I have to make it for my ver 19. 
  <a href="https://i.stack.imgur.com/hLEFQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hLEFQ.png" alt="enter image description here"></a></p>
  
  <p><strong>Update 5</strong></p>
  
  <p>I check What Vs2017 is doing in background. I used <a href="https://technet.microsoft.com/ja-jp/sysinternals/processmonitor.aspx" rel="nofollow noreferrer">ProcessMonitor</a>. and She execute this command. It look like no problem. I tried with Admin-MS-prompt, It success.</p>
  
  <pre><code>"C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x64\signtool.exe" sign /fd sha256 /f "Bg7Uwp1_TemporaryKey.pfx" "D:\develop\visualstudio2\shinwatec\Bg7Uwp1\Bg7Uwp1\bin\x64\Release\Bg7Uwp1_1.0.19.0_x64.appx"
  </code></pre>
  
  <p>but Without Admin, I got same error with VS2017 !</p>
  
  <p><a href="https://i.stack.imgur.com/lFjsp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lFjsp.png" alt="enter image description here"></a></p>