Select to view content in your preferred language

WinUI crash after publish

651
5
Jump to solution
02-20-2025 12:14 PM
Labels (1)
Jube
by
Emerging Contributor
Hi,

I tried to publish my WinUI app on the Microsoft Store, but the submission failed because the app crashed on launch during the certification process.
It was not easy to reproduce, it works fine on most computers, but I finally found a computer where I can reproduce the crash (Windows version 22h2 build 19045.5487).
The only thing I can get is a log in the Windows event viewer:

Faulting application name WinuiTest.exe, version: 1.0.0.0, timestamp: 0x67890000
Faulting module name: Microsoft.UI.Xaml.dll, version: 3.1.6.0, timestamp: 0xe431383e
Exception code: 0xc000027b
Error offset: 0x0000000000009125
Faulting process ID: 0x2788
Faulting application start time: 0x01db83ca329687cf
Faulting application path: C:\Program Files\WindowsApps\f8114a41-78bc-4318-be1c-b3362a2f2756_1.0.3.0_x64__qn7kvjefs86yt\WinuiTest.exe
Faulting module path: C:\Program Files\WindowsApps\Microsoft.WindowsAppRuntime.1.6_6000.401.2352.0_x64__8wekyb3d8bbwe\Microsoft.UI.Xaml.dll
Report ID: b5419f9b-41ed-4d68-9b02-b89d3215c011
Full name of the faulting package: f8114a41-78bc-4318-be1c-b3362a2f2756_1.0.3.0_x64__qn7kvjefs86yt
Application ID of the failing package: App

After installing Visual Studio on the target computer to debug the app, it not longer crashes, so it seems to be related to some missing runtimes.
I played with publish properties (SelfContained, etc...) in Visual Studio to try to embed in a single package all possible dependencies the app needs, but it keep crashing on this computer.

I created an app from scratch using the WinUI packaged app template.
When I publish it, the msix package is generated with a Dependencies folder containing Microsoft.WindowsAppRuntime.1.6.msix.
After installing it on the target computer, the app runs fine.

I added the Esri.ArcGISRuntime.WinUI 200.6 nuget package and initialized a SceneView.
The app works fine on my dev computer, and after publishing I get the same package files.
But once deployed, the app crashes on launch with this Microsoft.UI.Xaml.dll module error.

Here is a repo with my test app :

Here is the Certification report:
The product crashes at launch. The issue was observed on the following devices running OS build 22631.4602.
 
Observed On: Dell Inspiron 14 5000
Tested On: Dell Inspiron 14 5000
Error Message: N/A
 
Tested devices: HP 17-bs011dx

Thanks for your help.
0 Kudos
1 Solution

Accepted Solutions
dotMorten_esri
Esri Notable Contributor

This article seem to cover a bit half way down how to add the VCLibs as a dependency: https://learn.microsoft.com/en-us/windows/msix/desktop/desktop-to-uwp-prepare

It does look like if I add the following, that it shows up in the manifest of the generated app package, but no idea if that'll do the trick: 

dotMorten_esri_0-1740088857535.png


You could at least start with confirming whether it is a vclibs issue on the machine where you can reproduce, by installing the C++ Redistributable and verify if that addresses it.

View solution in original post

5 Replies
Jube
by
Emerging Contributor

Here is the publish result: WinuiTest_1.0.4.0_Test.zip

0 Kudos
dotMorten_esri
Esri Notable Contributor

I wonder if the machine is missing the C++ redistributable which is listed as a requirement for the .NET SDK (Visual Studio installs this too which explains why VS is fixing the crash)

 

You could also try and use ProcDump to get a better idea why it is crashing. I've seen weird crashes like this in WinUI, and the error does point to their module.

0 Kudos
dotMorten_esri
Esri Notable Contributor

This article seem to cover a bit half way down how to add the VCLibs as a dependency: https://learn.microsoft.com/en-us/windows/msix/desktop/desktop-to-uwp-prepare

It does look like if I add the following, that it shows up in the manifest of the generated app package, but no idea if that'll do the trick: 

dotMorten_esri_0-1740088857535.png


You could at least start with confirming whether it is a vclibs issue on the machine where you can reproduce, by installing the C++ Redistributable and verify if that addresses it.

Jube
by
Emerging Contributor

That was it!

After installing VC redist, no crash.
By adding <WinUISDKReferences>true</WinUISDKReferences> in the csproj, 2 VCLibs packages are published :

Jube_0-1740091096520.png

The app now works without the need to install VC redist.

Thanks!

0 Kudos
dotMorten_esri
Esri Notable Contributor

Great! Nice find on WinUISDKReferences property.

0 Kudos