microsoft-ui-xaml icon indicating copy to clipboard operation
microsoft-ui-xaml copied to clipboard

Faulting Module : Microsoft.UI.Xaml.DLL - Win32 WinUI 3 App not loading

Open OceanCyanTech opened this issue 3 years ago • 18 comments

Describe the bug

When I'm trying to run my WinUI 3 app, I get this error in Event Viewer:

Log Name: Application Source: Application Error Date: 29-05-2022 17:30:40 Event ID: 1000 Task Category: Application Crashing Events Level: Error Keywords: User: Computer: Description: Faulting application name: CompInfo.exe, version: 1.0.0.0, time stamp: 0x62571150 Faulting module name: Microsoft.ui.xaml.dll, version: 3.0.0.2204, time stamp: 0xe15d9c14 Exception code: 0xc000027b Fault offset: 0x0023bac9 Faulting process id: 0x0x59D8 Faulting application start time: 0x0x1D87353B61B4DB3 Faulting application path: C:\Program Files (x86)\CompInfo\CompInfo.exe Faulting module path: C:\Program Files\WindowsApps\Microsoft.WindowsAppRuntime.1.1-preview3_1000.485.2229.0_x86_8wekyb3d8bbwe\Microsoft.ui.xaml.dll Report Id: 0f4e4cd6-ed23-4b81-bf6d-7aaade61fcda Faulting package full name: Faulting package-relative application ID: Event Xml: <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">; <System> <Provider Name="Application Error" Guid="{a0e9b465-b939-57d7-b27d-95d8e925ff57}" /> <EventID>1000</EventID> <Version>0</Version> <Level>2</Level> <Task>100</Task> <Opcode>0</Opcode> <Keywords>0x8000000000000000</Keywords> <TimeCreated SystemTime="2022-05-29T12:00:40.7854474Z" /> <EventRecordID>6885</EventRecordID> <Correlation /> <Execution ProcessID="19768" ThreadID="24048" /> <Channel>Application</Channel> <Computer>Lenovo_laptop</Computer> <Security UserID="S-1-5-21-371826321-386045141-2969802394-1001" /> </System> <EventData> <Data Name="AppName">CompInfo.exe</Data> <Data Name="AppVersion">1.0.0.0</Data> <Data Name="AppTimeStamp">62571150</Data> <Data Name="ModuleName">Microsoft.ui.xaml.dll</Data> <Data Name="ModuleVersion">3.0.0.2204</Data> <Data Name="ModuleTimeStamp">e15d9c14</Data> <Data Name="ExceptionCode">c000027b</Data> <Data Name="FaultingOffset">0023bac9</Data> <Data Name="ProcessId">0x59d8</Data> <Data Name="ProcessCreationTime">0x1d87353b61b4db3</Data> <Data Name="AppPath">C:\Program Files (x86)\CompInfo\CompInfo.exe</Data> <Data Name="ModulePath">C:\Program Files\WindowsApps\Microsoft.WindowsAppRuntime.1.1-preview3_1000.485.2229.0_x86_8wekyb3d8bbwe\Microsoft.ui.xaml.dll</Data> <Data Name="IntegratorReportId">0f4e4cd6-ed23-4b81-bf6d-7aaade61fcda</Data> <Data Name="PackageFullName"> </Data> <Data Name="PackageRelativeAppId"> </Data> </EventData> </Event>

Steps to reproduce the bug

  1. Create a WinUI 3 app with Windows App SDK Runtime 1.0.3
  2. Build it as Non-Packaged
  3. Use Inno Setup to create a setup.exe
  4. Run it on a computer which has Windows App SDK Runtime 1.0.3 installed
  5. App doesn't open
  6. Open Event Viewer and find issue under Windows Logs> Application

Expected behavior

App runs smoothly

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.0.3

Windows app type

  • [ ] UWP
  • [X] Win32

Device form factor

Desktop

Windows version

Windows Insider Build (xxxxx)

Additional context

No response

OceanCyanTech avatar May 29 '22 13:05 OceanCyanTech

Did you install the Windows App SDK runtime on your machine? When your app is unpackaged you need it:

https://docs.microsoft.com/en-us/windows/apps/windows-app-sdk/deploy-unpackaged-apps#deploy-windows-app-sdk-runtime

marb2000 avatar Jun 20 '22 18:06 marb2000

Im experiencing this too, @OceanCyanTech did you ever get it working?

Faulting module name: Microsoft.ui.xaml.dll, version: 3.0.0.2206, time stamp: 0xfec042e2
Exception code: 0xc000027b
Fault offset: 0x000000000033f2d8

lukedukeus avatar Jul 14 '22 02:07 lukedukeus

I am having this same problem. My unpackaged app only runs on my machine. I've tested it with friends' Windows 10 machines and my wife's Windows 11 machine. All errors look like this :

Faulting application name: wingman.exe, version: 1.0.0.0, time stamp: 0x63c9df9f
Faulting module name: Microsoft.ui.xaml.dll, version: 3.0.0.2302, time stamp: 0x93c3ada5
Exception code: 0xc000027b
Fault offset: 0x00000000007cd8bc
Faulting process id: 0x0x38C
Faulting application start time: 0x0x1D955C8A6F93000
Faulting application path: d:\Store\net7.0-windows10.0.19041.0\wingman.exe
Faulting module path: d:\Store\net7.0-windows10.0.19041.0\Microsoft.ui.xaml.dll
Report Id: a9acd5cd-c47b-4fbc-a63c-5b51f02d421e
Faulting package full name: 
Faulting package-relative application ID: 

I am compiling with this :

    <WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
    <WindowsPackageType>None</WindowsPackageType>

I've personally overseen that every machine installs :

.Net7 (obviously)
VCRedist
and 
https://aka.ms/windowsappsdk/1.2/1.2.230217.4/windowsappruntimeinstall-x64.exe
https://aka.ms/windowsappsdk/1.2/1.2.230217.4/windowsappruntimeinstall-x86.exe

I have no idea how to triage what is going on here. I did notice when you install the WindowsAppRuntime, you get a Microsoft.UI.Xaml.DLL that shows : v2.8.2207.29001 , that is 6MB

But when I compile with <WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>, the same dll in the folder is v3.0.0.2302 (3.0.0-zmain.2302) and is 14.1MB

The full source of the app is here for reference :

https://github.com/dannyr-git/wingman

dannyr-git avatar Mar 13 '23 20:03 dannyr-git

This issue is happening for a packaged app installed from the Store as well. With all runtimes installed.

Might be related to this #8577, #8446 and #5746

It's caused by this error, as I got to find using windbg

0x80040154 (FACILITY_ITF - COM/OLE Interface Management): Class not registered

	Stack	 : 0x2342e4e6ee0
		7ff93d21fa0a Microsoft_ui_xaml!DirectUI::FrameworkApplication::StartDesktop+0x1c3886
		7ff93d07abde Microsoft_ui_xaml!DirectUI::FrameworkApplicationFactory::Start+0x6e
		7ff6e3566fad

Also, Microsoft states this as a know issue:

Potential run-time error in an app with Single-project MSIX that consumes types defined in a referenced Windows Runtime Component: To resolve, manually add activatable class entries to the appxmanifest.xml. The expected error in C# applications is “COMException: Class not registered (0x80040154 (REGDB_E_CLASSNOTREG)). The expected error in C++/WinRT applications is “winrt::hresult_class_not_registered”.

@marb2000 , any updates on this? it's been 2 years since this framework launched and this issue is affecting a lot of users that try to use apps developed with WinUI 3.

bogdan-patraucean avatar Jul 05 '23 20:07 bogdan-patraucean

I have a user who has experienced this error multiple times. Our app is packaged.

e0ff avatar Oct 27 '23 21:10 e0ff

I'm new to WinUI3, just trying to get off the ground. I have prior WPF experience, so it's not like I'm totally lost.

I'm attempting to build a traditional desktop application, having nothing to do with the Windows Store. I've eliminated the launch profile for the 'packaged' version of the app, along with the 'Assets' folder, and the Package.appxmanifest, which appeared related only to the Packaged/Store version.

Additionally, I've added these three setting to my .csproj file:

<EnableMsixTooling>false</EnableMsixTooling>
<WindowsPackageType>None</WindowsPackageType>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>

Running in Visual Studio 2022 works without an issue. Publishing to a folder has landed me on this thread with a crash:

Faulting application name: WinUIDesktop.exe, version: 1.0.0.0, time stamp: 0x65ab0000
Faulting module name: Microsoft.ui.xaml.dll, version: 3.1.4.0, time stamp: 0x343afd70
Exception code: 0xc000027b
Fault offset: 0x00000000003b9584
Faulting process id: 0x0x2514

Seems if I switch EnableMsixTooling back to 'true', everything works.

I didn't want to look into MAUI, as I don't need cross-platform. Was looking into WinUI 3 due to the component gallery, would save me a lot of time vs plain old WPF.

With leaving EnableMsixTooling set to true, I'm continuing, but this already feels 'fragile' out of the box. I would highly recommend a project template for starting an 'Unpackaged' application, in addition to it not crashing with the published version. You might also consider rebranding 'unpackaged' as 'Traditional Desktop' and maybe 'Packaged' as 'Windows Store', if that's appropriate.

CodeFontana avatar Feb 25 '24 07:02 CodeFontana

Coincidentally, 20 mins later, while browsing the WinUI 3 Gallery app, it also crashed on the same Microsoft.ui.xaml.dll:

Faulting application name: WinUIGallery.exe, version: 2.2.0.0, time stamp: 0x655e0000
Faulting module name: Microsoft.ui.xaml.dll, version: 3.1.4.0, time stamp: 0xd8e270fd
Exception code: 0xc000027b
Fault offset: 0x00000000003ba2f4

I was searching icons at the time.

CodeFontana avatar Feb 25 '24 07:02 CodeFontana

Seems if I switch EnableMsixTooling back to 'true', everything works.

Thanks @CodeFontana! I also got this in the event log after publishing the non package project generated by the "Blank App, Packaged with Windows Application Packaging Project" template.

This is supposed to work without that right?

karmeye avatar Feb 28 '24 04:02 karmeye

Seems if I switch EnableMsixTooling back to 'true', everything works.

Thanks @CodeFontana! I also got this in the event log after publishing the non package project generated by the "Blank App, Packaged with Windows Application Packaging Project" template.

This is supposed to work without that right?

I'm in the same boat-- I would believe you should be able to create a WinUI 3 app independently from MSIX and the Windows Store, but I can't say this for sure, as I'm new to this project type myself.

Seems WinUI project templates and settings need an overhaul. Disappointing it's so confusing/buggy out of the box!

CodeFontana avatar Feb 28 '24 06:02 CodeFontana

Installed :

image
  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
    <TargetPlatformMinVersion>10.0.22621.0</TargetPlatformMinVersion>
    <RootNamespace>Weather.History</RootNamespace>
    <Platforms>x86;x64;</Platforms>
    <RuntimeIdentifiers>win-x86;win-x64;</RuntimeIdentifiers>
    <DefaultLanguage>en</DefaultLanguage>
    <UseWinUI>true</UseWinUI>
    <EnableMsixTooling>true</EnableMsixTooling>
    <WindowsPackageType>MSIX</WindowsPackageType>
    <WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
  </PropertyGroup>

Deploy successfull and program icon appears in Windows start menu.

image

what is missing if self-contained is being demanded ? I wonder if WinUI will represent a workload in Visual Studio installer like MAUI does.

sigmarsson avatar Mar 15 '24 18:03 sigmarsson

I have the same problem. I tried the same thing and couldn't find a solution. I hope this will be solved soon.

ENGiDEERS avatar Apr 08 '24 18:04 ENGiDEERS

@ENGiDEERS https://stackoverflow.com/questions/78180962/faulting-module-name-microsoft-ui-xaml-dll

sigmarsson avatar Apr 08 '24 18:04 sigmarsson

Any update ??

book1625 avatar May 23 '24 07:05 book1625

Hi, I have build a packaged self-contain WinUI3 with the following setting added into the csproj file following instruction from https://learn.microsoft.com/en-us/windows/apps/package-and-deploy/self-contained-deploy/deploy-self-contained-apps and https://learn.microsoft.com/en-us/windows/msix/desktop/desktop-to-uwp-packaging-dot-net.

 <UseWinUI>true</UseWinUI>
    <EnableMsixTooling>true</EnableMsixTooling>
    <WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
    <SelfContained>true</SelfContained>
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
    ...
 <Target Name="_RemoveFrameworkReferences" BeforeTargets="_ConvertItems;_CalculateInputsForGenerateCurrentProjectAppxManifest">
<ItemGroup>
<FrameworkSdkReference Remove="@(FrameworkSdkReference)" Condition="$([System.String]::Copy('%(FrameworkSdkReference.SDKName)').StartsWith('Microsoft.WindowsAppRuntime.'))" />
</ItemGroup>
</Target>

The application can run in VS with no problems. However, the published MSIX package application can not run and throw the following error in event reviewer. Thanks.

image

arthur28197 avatar May 24 '24 08:05 arthur28197

Pls. all be careful to state 'I have the same problem here' with this "c000027b" Exception!

FYI: https://learn.microsoft.com/en-us/shows/inside/c000027b

IMHO this error is happening deep in the guts of Win UI XAML code. Unfortunately it is not much of a help when it happens:

... If the exception is not handled by the caller, the stowed exception is thrown fatally. Because the throwing is deferred, the current context of the associated dump has little value. ...

My own instance of this problem was simply caused by my 'stupidly misusing' of a Component in my XAML while I did not fully understand this component at that time. My symptoms where as described here

the application can run in VS with no problems. However, the published MSIX package application can not run and throw the following error in event reviewer ....

see here for details Providing a corrected version of my own XAML solved it.

That said, I am hoping that future versions of WinUI3 do improve the developer experience in this area.

RobertK66 avatar Jun 03 '24 13:06 RobertK66

ere as describe

Unfortunately I stepped into these 2 error

  1. Windows 10 : Faulting application name: mauisland.exe, version: 1.0.0.0, time stamp: 0x65a80000 Faulting module name: KERNELBASE.dll, version: 10.0.19041.4355, time stamp: 0xd7762934
  2. Windows 11 :Faulting application name: mauisland.exe, version: 2.0.0.0, time stamp: 0x661f0000 Faulting module name: Microsoft.ui.xaml.dll, version: 3.1.5.0, time stamp: 0x7fd76c03

My problem is the project launch in release mode just fine both Debug and Release run the like charm, but when deployed to MSIX it crash on start which make me really frustrated to located where the issue really is

Strypper avatar Jun 05 '24 04:06 Strypper

I have the same issue with the same exception code.

It's easily reproducible on my machine when I build the MSIX package with both /p:PublishSelfContained=true /p:WindowsAppSDKSelfContained=true. Our crucial requirement is for the app to run self-contained on an offline machine - only setting /p:PublishSelfContained=true wont allow us to install & run app on offline machine because of:

image

malciin avatar Jul 10 '24 07:07 malciin