Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In UWP Release version cannot run by double clicking the exe file in the folder? #4407

Closed
sudharsan-narayanan opened this issue May 13, 2024 · 4 comments
Labels
area-UWP Support for UWP apps

Comments

@sudharsan-narayanan
Copy link

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

  1. Create a new UWP project.
  2. Add any MS control.
  3. Run the UWP project.
  4. 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

@ghost1372
Copy link
Contributor

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

@jonwis
Copy link
Member

jonwis commented May 13, 2024

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.

@DrusTheAxe
Copy link
Member

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/

@codendone codendone added the area-UWP Support for UWP apps label May 23, 2024
@codendone
Copy link
Contributor

Closing as answered / By Design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-UWP Support for UWP apps
Projects
None yet
Development

No branches or pull requests

5 participants