Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WinUI 3 release mode crash Microsoft.ui.xaml.dll, #9914

Closed
jpcassano opened this issue Aug 21, 2024 · 3 comments
Closed

WinUI 3 release mode crash Microsoft.ui.xaml.dll, #9914

jpcassano opened this issue Aug 21, 2024 · 3 comments
Labels
bug Something isn't working needs-triage Issue needs to be triaged by the area owners

Comments

@jpcassano
Copy link

jpcassano commented Aug 21, 2024

Describe the bug

When trying to launch a packaged WinUI 3 application in Release mode that was created using the Blank App, Packaged (WinUI 3 in Desktop) project template, I receive an exception stating, "Faulting module name: Microsoft.ui.xaml.dll, version: 3.1.5.0" and the application crashes.

Steps to reproduce the bug

  1. Launch Microsoft Visual Studio Professional 2022 (64-bit) - Version 17.11.1 on Windows 11 Pro Version 23H2 Build 22631.4037.
  2. Select Create a new project and use the Blank App, Packaged (WinUI 3 in Desktop) project template to create a new project.
  3. Add the <WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained> parameter to the application .csproj file to indicate that the application should be self contained.
  4. Select release and x64 from the configuration manager and try to run the application.
  5. The application crashes

Expected behavior

The application should launch without an exception.

Screenshots

image
image
image
image
image
image

NuGet package version

WinUI 3 - Windows App SDK 1.5.6: 1.5.240802000

Windows version

Windows 11 (22H2): Build 22621

Additional context

The application also crashes after successfully installing if you use the create app package option by right clicking the project file and following the steps to sideload the app. The msix is created and installs the app but the application will crash when launching and the event viewer shows "Faulting module name: Microsoft.ui.xaml.dll, version: 3.1.5.0",

@jpcassano jpcassano added the bug Something isn't working label Aug 21, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Aug 21, 2024
Copy link

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@jpcassano
Copy link
Author

jpcassano commented Aug 21, 2024

As described in the comments of the linked issues this is a bug that will be fixed in Windows App SDK 1.6. The workaround for this issue is to set <PublishTrimmed>false</PublishTrimmed> in the pubxml files for release builds.

@microsoft-github-policy-service microsoft-github-policy-service bot added needs-triage Issue needs to be triaged by the area owners and removed needs-triage Issue needs to be triaged by the area owners labels Aug 21, 2024
@codendone codendone removed the needs-triage Issue needs to be triaged by the area owners label Aug 22, 2024
@Cyp9715
Copy link

Cyp9715 commented Sep 27, 2024

<PropertyGroup>
  <PublishTrimmed Condition="'$(Configuration)' == 'Debug'">False</PublishTrimmed>
  <PublishTrimmed Condition="'$(Configuration)' != 'Debug'">False</PublishTrimmed>
</PropertyGroup>

Modifying the .pubxml file as shown above resolved the issue.
However, why has Microsoft set this as the default option to True?
Honestly, I'm not entirely sure what this feature does, but if there is a potential issue, it would be better to set False as the default option to ensure proper functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Issue needs to be triaged by the area owners
Projects
None yet
Development

No branches or pull requests

3 participants