WindowsAppSDK
WindowsAppSDK copied to clipboard
WinAppSDK application doesn't launch for some users
Describe the bug
The application doesn't launch or display any UI for both packaged (Sideload) and unpackaged(Self-contained) version of the application. it works on some machines but doesn't work for others using Windows 10 or 11.
Eventviewer gives me this:
Faulting application name: Decorator.App.exe, version: 1.0.0.0, time stamp: 0x63557f1f
Faulting module name: KERNELBASE.dll, version: 10.0.19041.2364, time stamp: 0x5b7d4d22
Exception code: 0xc000027b
Fault offset: 0x000000000010fe32
Faulting process id: 0x12a8
Faulting application start time: 0x01d92801ab61a1cd
Faulting application path: C:\Users\username\Downloads\Executables\Decorator.App.exe
Faulting module path: C:\Windows\System32\KERNELBASE.dll
Report Id: c3a5498b-f1c3-40ce-8fb8-b44e3d3c971d
Faulting package full name:
Faulting package-relative application ID:
Steps to reproduce the bug
- Install the application using the powershell script
- launch the app
Expected behavior
The application should launch
Screenshots
No response
NuGet package version
Windows App SDK 1.2.2: 1.2.221209.1
Packaging type
Packaged (MSIX), Unpackaged
Windows version
Windows 11 version 22H2 (22621, 2022 Update)
IDE
Visual Studio 2022-preview
Additional context
Trying to launch the unpackaged app if I don't specify SelfContained and WindowsAppSDKSelfContained gives this error
Windows App Runtime
ERROR 0x80070005: Bootstrapper initialization failed while looking for version 1.2
Although the runtime is installed
Same issue here with some users, MSIX Self-Contained.
See https://musehub.zendesk.com/hc/en-gb/community/posts/8750729751709-MuseHub-has-no-UI-Windows-11-
Maybe related: https://github.com/microsoft/WindowsAppSDK/issues/3037
Maybe related: #3037
He solved the issue here by reinstalling windows which I can't do for every user that has this issue
@MohamedA-Ibrahim Have you checked this guide for WindowsAppSDK deployment?
Here is some sample DeploymentManager code required if you haven't specified <WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained> in your csproj:
if (DeploymentManager.GetStatus().Status != DeploymentStatus.Ok)
{
Debug.WriteLine("[App]: DeploymentManager status: " + DeploymentManager.GetStatus().Status);
var initializeTask = Task.Run(DeploymentManager.Initialize);
initializeTask.Wait();
if (initializeTask.Result.Status == DeploymentStatus.Ok)
{
Debug.WriteLine("Installed Windows App Runtime successfully!");
}
}
I've placed it in my apps in App.xaml.cs before the InitializeComponent() call.
It ensures that all required Windows App Runtime packages are installed and one of which is responsible for keeping them updated like the guide from Microsoft I posted before explains.
I think at the moment it requires you to add the restricted packageManagement capability to your appxmanifest:
<rescap:Capability Name="packageManagement"/>
Here is some sample
DeploymentManagercode required if you haven't specified<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>in your csproj:if (DeploymentManager.GetStatus().Status != DeploymentStatus.Ok) { Debug.WriteLine("[App]: DeploymentManager status: " + DeploymentManager.GetStatus().Status); var initializeTask = Task.Run(DeploymentManager.Initialize); initializeTask.Wait(); if (initializeTask.Result.Status == DeploymentStatus.Ok) { Debug.WriteLine("Installed Windows App Runtime successfully!"); } }I've placed it in my apps in App.xaml.cs before the
InitializeComponent()call. It ensures that all required Windows App Runtime packages are installed and one of which is responsible for keeping them updated like the guide from Microsoft I posted before explains.I think at the moment it requires you to add the restricted packageManagement capability to your appxmanifest:
<rescap:Capability Name="packageManagement"/>
Tried this and still get the same error. I also get this error when I publish the app as SelfContained (Both SelfContained and WindowsAppSDKSelfContained set as true)
Although the runtime is installed
What's reported by
powershell -c $(get-appxpackage micro*win*app*run*).packagefullname
Although the runtime is installed
What's reported by
powershell -c $(get-appxpackage micro*win*app*run*).packagefullname
MicrosoftCorporationII.WinAppRuntime.Main.1.2_2000.707.2303.0_x64__8wekyb3d8bbwe MicrosoftCorporationII.WinAppRuntime.Singleton_2000.707.2303.0_x64__8wekyb3d8bbwe Microsoft.WinAppRuntime.DDLM.2000.707.2303.0-x6_2000.707.2303.0_x64__8wekyb3d8bbwe Microsoft.WinAppRuntime.DDLM.2000.707.2303.0-x8_2000.707.2303.0_x86__8wekyb3d8bbwe Microsoft.WindowsAppRuntime.1.2_2000.707.2303.0_x64__8wekyb3d8bbwe Microsoft.WindowsAppRuntime.1.2_2000.707.2303.0_x86__8wekyb3d8bbwe
I'm experiencing the same issue. I tested my app on 5 different computers and 2VMs. Its 50/50 if its working, I tried setting SelfContained and WindowsAppSDKSelfContained, use the code provided, nothing works.
Also this command powershell -c $(get-appxpackage micro*win*app*run*).packagefullname just throws error in powershell on some computers.
Honeslty after 5 days of debugging this I give up. The expreience of using this SDK is terrible.
In my experience if I clone the repo (https://github.com/Levminer/cores) and build it in VS on the machine that doesn't work the issue fixes itself. I think VS installs some dependency that the WindowsAppSDK not installs.
I think at the moment it requires you to add the restricted packageManagement capability to your appxmanifest:
<rescap:Capability Name="packageManagement"/>
It does if you're running in an AppContainer
@sachintaMSFT would this suffice on Win10 if you're MediumIL or is the Win10 service update required too? instead of?
I tested my app on 5 different computers and 2VMs
What SKUs/versions of Windows were these? Run winver.exe for one option how to determine this.
powershell -c $(get-appxpackage micro*win*app*run*).packagefullnamejust throws error in powershell on some computers.
If that errors something's wrong with that machine. What error(s) do you get?
If it's a Powershell execution issue powershell -c Get-ExecutionPolicy -List may be helpful.
@DrusTheAxe
This is a VM: 
This is my personal computer (the app works but the command throws error):

In my case, App crashed when ran debug in some OS, but release is fine.
Hmmmm. That 1st part of your error message is odd - it's confusing the package full name return value (the 1st returned?) as the command rather than the output data?
What version of Powershell are you using?
Try these commands:
powershell -c $PSEdition
powershell -c $PSHOME
powershell -c $PSVersionTable
P.S. Most peculiar. I've never seen Get-AppxPackage fail in 10+ years e.g.

In my case, App crashed when ran debug in some OS, but release is fine.
Did you build your app's project in VS with its default Debug configuration?
VS' Debug configurations use the Debug CRT, not the CRT. The Debug CRT is not a redistributable and only installed via VS. Running a .exe (or loading a .dll) built with the Debug configuration on a machine w/o VS installed will fail because its Debug CRT .dll imports won't be resolved.
When I use VS I always fiddle with the Debug config to use the same CRT as the Release config. I lose the debug CRT's extra heap checks but don't find that such a problem these days with C++ and RAII and smart pointer etc. But that's just me. To each their own.
In my case, App crashed when ran debug in some OS, but release is fine.
Did you build your app's project in VS with its default Debug configuration?
VS' Debug configurations use the Debug CRT, not the CRT. The Debug CRT is not a redistributable and only installed via VS. Running a .exe (or loading a .dll) built with the Debug configuration on a machine w/o VS installed will fail because its Debug CRT .dll imports won't be resolved.
When I use VS I always fiddle with the Debug config to use the same CRT as the Release config. I lose the debug CRT's extra heap checks but don't find that such a problem these days with C++ and RAII and smart pointer etc. But that's just me. To each their own.
Yes, you're right, if I install VS, it can be run as normal. I refer link and I though it should be run success w/o VS installed. So, just another question: if I build release but link to debug dll, do I need to install VS to run?
Hmmmm. That 1st part of your error message is odd - it's confusing the package full name return value (the 1st returned?) as the command rather than the output data?
What version of Powershell are you using?
Try these commands:
powershell -c $PSEdition powershell -c $PSHOME powershell -c $PSVersionTableP.S. Most peculiar. I've never seen Get-AppxPackage fail in 10+ years e.g.
My bad I was running the command from powershell, not cmd. This is from the VM, where the app doesn't work. I tried using the new experimental version, same as 1.2
Microsoft.WindowsAppRuntime.1.3-experimental1_3000.763.701.0_x64__8wekyb3d8bbwe
Microsoft.WindowsAppRuntime.1.3-experimental1_3000.763.701.0_x86__8wekyb3d8bbwe
MicrosoftCorporationII.WinAppRuntime.Main.1.3-e1_3000.763.701.0_x64__8wekyb3d8bbwe
MicrosoftCorporationII.WinAppRuntime.Singleton-e1_3000.763.701.0_x64__8wekyb3d8bbwe
Microsoft.WinAppRuntime.DDLM.3000.763.701.0-x6-e1_3000.763.701.0_x64__8wekyb3d8bbwe
Microsoft.WinAppRuntime.DDLM.3000.763.701.0-x8-e1_3000.763.701.0_x86__8wekyb3d8bbwe
Updated to the latest version (1.2.4), now the build is broken on my computer too ;). Good job Microsoft!
Unpackaged and WindowsAppSDKSelfContained true
Event viewer:

Trying to debug the crash dump with VS:

Are there any good resources for debugging 0xC000027B exceptions? Especially on user machines?
Every now and again I have another user who cannot run an app because of this crash, and I can never repro it or find a common cause.
This is self-contained MSIX (With not self-contained .NET 6)
Are there any good resources for debugging 0xC000027B exceptions? Especially on user machines?
Currently a crash dump is required to investigate the cause of stowed exception crashes. For apps connected to Partner Center, the crash titles produced from analyzing crash dumps can also be useful.
If you or a user can collect a crash dump, this can help to convert the "0xC000027B" to more useful info: Stowed Exception crashes (exception code: 0xc000027b)
Ah I remember coming across that doc a while ago, better bookmark it. Thanks!
I found this issue after some googling. I just upgraded my Maui app to .net 8 RC1, which I belive includes a reference to the WindowsAppSDK 1.3.230724000 .
Well, all release builds for Windows now crash on startup and event viewer is showing the infamous "stowed" exception mentioned here :/
I even followed the adventurous guide, which forced me to download a PDE.zip from a onedrive folder and copy that into my local WinDBG installation ö_Ö
Can somebody please look at the Log output in my issue and give me a hint what might be wrong? I can't make head or tail from that output...
@DDHSchmidt: A portion of your PDE output:
Stowed Exception #2 @ 0x0000027127dd59f8
0x80131534 (FACILITY_URT - .NET CLR): Uncaught exception during type initialization.
Stack : 0x27127dd49e0
7ff986c9a81b Microsoft_ui_xaml!DirectUI::CRoutedEventSourceBase<DirectUI::IUntypedEventSource,ABI::Microsoft::UI::Xaml::IRoutedEventHandler,IInspectable,ABI::Microsoft::UI::Xaml::IRoutedEventArgs>::Raise+0x18c4b3
7ff986b0e312 Microsoft_ui_xaml!DirectUI::CRoutedEventSourceBase<DirectUI::IUntypedEventSource,ABI::Microsoft::UI::Xaml::IRoutedEventHandler,IInspectable,ABI::Microsoft::UI::Xaml::IRoutedEventArgs>::UntypedRaise+0x92
7ff986a574fa Microsoft_ui_xaml!CCoreServices::CLR_FireEvent+0x3da
7ff986a5710d Microsoft_ui_xaml!CommonBrowserHost::CLR_FireEvent+0x1d
...
7ff9869cd303 Microsoft_ui_xaml!CEventManager::RaiseLoadedEvent+0xeb
It looks like an app or control Loaded event handler threw a managed exception. Do you see any interesting .NET exceptions get thrown on startup, particularly in a Loaded event handler?
This happens only in Release-Mode, with no debugging symbols let alone a debugger being attached. There's no "interesting" exceptions in Windows' event viewer other than what I had posted in the original issue. Can you give me a hint on how I can catch that juicy .Net exception under these circumstances?
Are there any good resources for debugging 0xC000027B exceptions? Especially on user machines?
Currently a crash dump is required to investigate the cause of stowed exception crashes. For apps connected to Partner Center, the crash titles produced from analyzing crash dumps can also be useful.
If you or a user can collect a crash dump, this can help to convert the "0xC000027B" to more useful info: Stowed Exception crashes (exception code: 0xc000027b)
JFYI. Using the instructions on that page, and downloading windbg from the store, you can't install the PDE extension because windbg was downloaded from the store, and is in a secure location that you can't copy files into.
I'm trying to debug a Windows App SDK 1.5 app that gets this 0xc000027b error when run in my test VM.
SOme more reading on other semi-related repos found this. To add an extension to windbg when you are using the store-deployed version, put the extension here:
%LOCALAPPDATA%\Dbg\EngineExtensions