Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UWP app won't launch on second machine

Tags:

c#

windows

xaml

uwp

I started a UWP app on a laptop running Visual Studio 2015 Update 3. All was well and good, able to run and test it on both my laptop and my phone with no issues at all.

I added the project to Source Control (private Git server) and pulled the repo on my home PC. The project opens in VS2015 Update 3 on my PC and I can develop and build with no issues. However, I can't seem to run the app on my PC running Windows 10 Build 15063 (same as the laptop). At first I thought it was the temporary certificate, but I tried both creating a new one and adding the one from the working laptop to Source Control. Here is the error:

An unhandled exception of type 'System.UnauthorizedAccessException' occurred in MyUwpApp.exe

Additional information: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

Stack trace:

   at Windows.UI.Xaml.Application.Start(ApplicationInitializationCallback callback)
   at MyUwpApp.Program.Main(String[] args)

It doesn't even hit the OnLaunched event on the App.xaml.cs.

I have both machines with Developer Mode enabled as I've used my PC for other projects. It's also worth noting that creating a blank Universal app on the PC works fine.

Any help would be greatly appreciated as I don't want to be stuck with developing on a laptop when I have a more powerful PC (which also runs a LOT cooler than the laptop in this UK heatwave...)

Edit

The laptop I created the project on is encrypted with BitLocker. Could this cause the issue?

Edit 2

If I create a brand new blank UWP app, it runs fine, however if I then copy over the source files from the original, install all packages and update namespaces, I get the access denied error again.

like image 980
Matt Brewerton Avatar asked Oct 30 '22 06:10

Matt Brewerton


2 Answers

I had the same problem. Temporary solution: you can open access to editing and reading for all your bin\debug folders.

The problem is VS does not have the right to write to the bin\debug\appx folder.

EDIT

Check your VS user account permissions. enter image description here

like image 146
Vladimir Bolshakov Avatar answered Nov 15 '22 06:11

Vladimir Bolshakov


So as it turns out, my Antivirus (Comodo) was containing the applications which meant they didn't have access to anything outside of the AV container.

Unblocking the applications and allowing them to run as normal fixed my issue.

like image 26
Matt Brewerton Avatar answered Nov 15 '22 04:11

Matt Brewerton