WinUI3 apps close after showing the splash screen when launched with an executionAlias
See original GitHub issueDescribe the bug
If a WinUI3 app is launched with an execution alias the app starts but automatically closes after briefly showing the splash screen.
Steps to reproduce the bug
Steps to reproduce the behavior:
- Create a new, empty WinUI3 desktop app from the VSIX template (version 3.0.0.2007130)
- Add the following to
package.appxmanifest
as a child of theApp
element.
<Extensions>
<uap5:Extension
Category="windows.appExecutionAlias"
Executable="$targetnametoken$.exe"
EntryPoint="$targetentrypoint$">
<uap5:AppExecutionAlias>
<uap5:ExecutionAlias Alias="MyTestApp.exe" />
</uap5:AppExecutionAlias>
</uap5:Extension>
</Extensions>
(If using a UWP app set the EntryPoint as {AppName}.App
)
- Add the XML Namespace alias
xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5"
- Run the app from VS to deploy it locally
- Run the app from the command line
c:\> MyTestApp.exe
Expected behavior
App should launch without issue
Screenshots
Version Info
NuGet package version: Microsoft.WinUI 3.0.0-preview2.200713.0
Windows app type:
UWP | Win32 |
---|---|
Yes | Yes |
Windows 10 version | Saw the problem? |
---|---|
Insider Build (xxxxx) | |
May 2020 Update (19041) | Yes |
November 2019 Update (18363) | |
May 2019 Update (18362) | |
October 2018 Update (17763) | |
April 2018 Update (17134) | |
Fall Creators Update (16299) | |
Creators Update (15063) |
Device form factor | Saw the problem? |
---|---|
Desktop | Yes |
Xbox | |
Surface Hub | |
IoT |
Additional context
If in a WinUI3 UWP app, setting the Start action as “Do not launch, but debug my code when it starts” and adding a break point in the App Constructor , the break point is never hit. (I don’t know how to test the equivalent in a desktop app–or if it’s possible)
The error code/level after unsuccessfully launching an app from an alias is reported as 0. This is a success error code and so is misleading.
The same/equivalent functionality works fine for a pre-WinUI3/regular UWP app.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:15 (10 by maintainers)
Top GitHub Comments
Without this functionality it is not possible to pass command-line arguments to apps. While “Desktop” apps are being equated with “Win32” apps I feel the lack of command-line support is a big gap.
Currently this issue isn’t even mentioned on the roadmap. With the GA release planned for H12021 and quarterly point releases after that, it looks as if command line support won’t be available until at least Q4 2021.
This is a serious blocker for allowing WinUI3 apps from integrating with existing apps.
@mrlacey, I agree with you. This issue is not related to the original subject. The reason, I decided that it does not work, was I use the Power Shell console in my daily work. I could not imagine that the command line console would work better than Power Shell ))))
Anyway, it is strange that I can execute winver.exe from the Power Shell (whether by its name or by Start-Process) but I cannot execute MyDesktopTest.exe the same way. Another strange thing, when I type the command, which does not exist, I see a specific error in the response, but when I type MyDesktopTest.exe, there is no response. Looks like the app is launched but silently crashes.
In the command line, all work as expected.
And thank you @mrlacey for the precise and clear instructions. It was very helpful for me.