WindowsAppSDK
WindowsAppSDK copied to clipboard
In UWP Release version cannot run by double clicking the exe file in the folder?
Describe the bug
When UWP compiled into Release version, after build
Cannot run by double clicking the exe file in the folder?
Steps to reproduce the bug
- Create a new UWP project.
- Add any MS control.
- Run the UWP project.
- Now open the bin folder and try to launch the exe.
Note: exe won't launch.
Expected behavior
Need to launch the exe in double click by UWP.
Screenshots
No response
NuGet package version
Windows App SDK 1.5.3: 1.5.240428000
Packaging type
No response
Windows version
No response
IDE
No response
Additional context
No response
UWP app can not be opened by exe! If you mean winui app or wasdk app you need to change your app from packaged to unpackaged so you can run your app by double clicking on exe file
Generally, packaged apps are designed to only run when activated - like launched from the start menu, or from a file-type/protocol-scheme invocation, etc. Windows App SDK does not support UWP (packaged, AppContainer, CoreWindow presentation, CoreApplication lifecycle) applications at this time.
As @ghost1372 says, UWP applications built with the Windows Platform SDK using one of the Visual Studio Universal Windows App projects cannot be launched by double-click. Instead, use the "Run" option in Visual Studio. Or use the "Deploy" option and then find your application in the Start Menue.
This is by design.
Generally, packaged apps are designed to only run when activated
As Jon mentioned, UWP apps are run via activation via ApplicationActivationManager's ActivateApplication() or AppListEntry.LaunchAsync(). This is what Visual Studio does when you hit F5 to run you project.
But if you need to run your app by launching an executable (via CreateProcess, ShellExecute, etc) you can define an App Execution Alias for your app and run that.
Here's additional information about App Executation alias: https://blogs.windows.com/windowsdeveloper/2017/07/05/command-line-activation-universal-windows-apps/
Closing as answered / By Design.