Home > Software engineering >  C# UWP app closes immediately when launching EXE?
C# UWP app closes immediately when launching EXE?

Time:10-31

So I've written a little UWP app in C#. Usually when launching an app from the EXE in the Debug/Release folders, like a .NET forms app or a WPF app or something, it just works. However with UWP, I'm finding nothing happens. If I look in Task Manager, I can see the application loads for a second and then just closes without an error. It's strange because it works fine when debugging in Visual Studio.

Can anyone help?

CodePudding user response:

UWP app is different from normal executables and can't be launched from exe file, you'll have to sideload it first, which Visual Studio automatically does for you when debugging.

CodePudding user response:

@Sardelka is correct. In addition to his answer, there is something I want to add. When the UWP app is running, the UWP app will be wrapped in an appcontainer and the app is isolated in the Sandbox. That's why you can't just launch it from the .exe file.

  • Related