Search code examples
c#visual-studiouwp

Why won't UWP app run outside Visual Studio?


As a test, I created a single page UWP app in Visual Studio 17.5.3 using C#. I dropped a few components into MainPage.xaml, then hit the RUN button. The app loads and you see the main page.

However, if I switch to "Release" and "X64" options, then build the app, then go to the app/bin/x64/Release directory and attempt to run the app's .exe file, nothing happens. No window appears, no error message appears, nothing appears in the Windows Application Log.

I can see the app exe file show up in Task Manager for a brief second then it disappears.

My system is 64-bit Windows 10 Home 22H2 version.

Thanks for any guidance.


Solution

  • Why won't UWP app run outside Visual Studio?

    UWP apps are different with normal desktop apps. UWP apps are running in a AppContainer and is isolated in the sandbox. So you can't directly run the UWP app by double-click the exe file.

    If you want to launch the app on the same device without VS, you just need to find it in the App list in the Start Menu. Then click your app to launch it.

    If you need to deploy the UWP app for other devices, you could try to create a sideload package which is signed by your own certificate. Then install the certificate and the sideload package on these different devices. After that, you could launch the app in the Start Menu.