-
Notifications
You must be signed in to change notification settings - Fork 697
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
A class library with a ResourceDictionary will crash with AOT/Trim enabled #10020
Comments
i found that this is related to Trim and i uploaded a Repro sample. @codendone Is there any news about fixing this bug? Actually, I can't publish any app Open CsProj file and make sure Trim is enabled in Debug/Release
|
I tested your repro project and it works correctly here. Make sure you use an up-to-date .net installation so that the cswinrt source generator runs. |
Thank you. |
I fixed all the crashes by installing |
Describe the bug
I have a class library that contains some ResourceDictionaries which i refrence them into app.xaml
, When I activate the
PublishAOT
orTrim
switch:<PublishAOT>true</PublishAOT>
<PublishTrimmed>true</PublishTrimmed>
My app does not run in debug or release or publish mode at all.
In debug mode, I get the following exception
after removing my resource dictionary refrences from app.xaml My app runs without problems.
I also tried this with a new class library and an empty resource dictionary and issue exist
Steps to reproduce the bug
1.Create a New WinUI 3 Project
2.Make sure your BuildTools is 22621.3232 (latest build tools can not be launch in AOT)
3.Create a Class Library with a Resource Dictionary (Create a nuget package)
4.Add Class Library to Project
5.Add Resource Dictionary in App.xaml
6.Run app (Works fine)
7.Add
<PublishAOT>true</PublishAOT>
or<PublishTrimmed>true</PublishTrimmed>
8.Try to run app (app will be crash)
Expected behavior
App Should be Run/Launch without any issues
Screenshots
No response
NuGet package version
Windows App SDK 1.6.0: 1.6.240829007
Packaging type
Packaged (MSIX), Unpackaged
Windows version
Windows 11 version 22H2 (22621, 2022 Update)
IDE
Visual Studio 2022-preview, Visual Studio 2022
Additional context
No response
The text was updated successfully, but these errors were encountered: