microsoft-ui-xaml: WINUI 3 Unable to Run Published App Due To KERNELBASE.dll Crash

Describe the bug

I cannot get any WINUI desktop apps I create to run outside of Visual Studio however I publish them (single app or lots of files and with or without ClickOnce installation. I am using the 17.1 version of Visual Studio 2022 on the latest Windows 11 insider build.

Steps to reproduce the bug

Create a new Blank App, Packaged (WINUI 3 in Desktop) and then publish this (for example selecting ClickOnce then the single file option or deploying all files to a share). Nothing happens when the .exe is launched and looking in Event Viewer Application log the following errors appears:

First this one:

Application: App1.exe
CoreCLR Version: 6.0.222.6406
.NET Version: 6.0.2
Description: The process was terminated due to an unhandled exception.
Exception Info: System.DllNotFoundException: Dll was not found.
   at App1.Program.Main(String[] args)

Then this one:

Faulting application name: App1.exe, version: 1.0.0.0, time stamp: 0x61e1d094
Faulting module name: KERNELBASE.dll, version: 10.0.22557.1, time stamp: 0xab780977
Exception code: 0xe0434352
Fault offset: 0x00145df2
Faulting process ID: 0x0x5B90
Faulting application start time: 0x0x1D82778001B2502
Faulting application path: C:\Users\robin.wilson\AppData\Local\Apps\2.0\6WEQ0LKJ.QKZ\CM4PW9HN.PCX\app1..tion_0000000000000000_0001.0000_8e4f39cd130acc58\App1.exe
Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
Report ID: 253e7f9c-9d74-492f-9f03-89af28e232fc
Faulting package full name: 
Faulting package-relative application ID: 

Expected behavior

The app should launch and display the main window

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.0

Windows app type

  • UWP
  • Win32

Device form factor

No response

Windows version

No response

Additional context

No response

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 6
  • Comments: 16 (1 by maintainers)

Most upvoted comments

Stay away from this stinker.