Home > Software design >  Windows 10 UWP App crash at start (Faulting module name: Windows.UI.Xaml.dll)
Windows 10 UWP App crash at start (Faulting module name: Windows.UI.Xaml.dll)

Time:10-11

I have a sideload AppXBundle UWP app but I need call another app from UWP so I have Windows Application Packaging Project where is my UWP app set as entry point. Everything worked well, but after some time when the application worked without changes, so We tried to install this application on a new Windows build and now after start We get this error:

Faulting application name: SampleApp.UWP.exe, Version: 1.0.0.0, Timestamp: 0x601d0acc
Faulting module name: Windows.UI.Xaml.dll, version: 10.0.19041.1151, timestamp: 0x4a600fea
Exception code: 0xc000027b
Fault offset: 0x008350e1
Faulting process id: 0x32ac
Faulting application start time: 0x01d7bb437797a43a
Faulting application path: C:\Users\user\source\repos\SampleApp\src\SampleApp.Package\bin\x86\Debug\AppX\SampleApp.UWP.exe
Faulting module path: C:\Windows\System32\Windows.UI.Xaml.dll
Report Id: d3fe4cda-8453-44a7-9584-a4e75a4b625b
Faulting package full name: 32ccd31a-20e9-4379-92c7-3cb29f6d9364_1.0.0.0_x86__m1eq83gekd84y
Faulting package-relative application ID: App

I tried deploy or install sideload only UWP app project and it works but when deploy or install package project it crash after start. It all worked well I think on Windows 10 version 1903 build 18362 but now I have Windows 10 version 20H2 build 19042.1237 and it does not work.

Windows Application Packaging Project and UWP app target has been set (when it works):

  • Target version: Windows 10 version 1903 build 18362
  • Min version: Windows 10 Fall Creators Update build 16299

Now I tried:

  • Target version: Windows 10 version 2004 build 19041
  • Min version: Windows 10 version 1803 build 17134

but still same problem...

When I creating App Packages in configuration I have architecture x86 Debug(x96) only.

I have sample project for reproduce this problem HERE. When deploy or Publish -> Create App Packages in SampeApp.Package project it crash after start but when I deploy or publish only SampleApp.UWP project it works.

CodePudding user response:

After checking the sample I found that the way you packaging your app is very different from the way we recommended it. It's not a good way to add your desktop app as a reference to the UWP app. And you didn't launch the core app even you've registered the runfulltrust capability.

I'd suggest you take a look at @Stefan Wick's Blog - UWP with Desktop Extension Part 1,2,3. You could search for them in your browser. These tutorials show the way how to package desktop apps with UWP apps using Windows Application Packaging Project. Then the UWP could communicate with the desktop app to do what you want.

CodePudding user response:

I found a solution HERE by adding UseAppLocalCoreFramework in .csproj PropertyGroups.

<UseAppLocalCoreFramework>true</UseAppLocalCoreFramework>

or adding ResolvePackageDependenciesForBuild to the end of the .wapproj (packaging project file).

<Target Name="ResolvePackageDependenciesForBuild" />
  • Related