Custom ResourceDictionary fails to load in .NET 9 app #26348
Labels
area-xaml
XAML, CSS, Triggers, Behaviors
fixed-in-9.0.21
platform/windows 🪟
s/triaged
Issue has been reviewed
s/try-latest-version
Please try to reproduce the potential issue on the latest public version
t/bug
Something isn't working
Milestone
Description
When create a subclass of ResourceDictionary with merged dictionaries for a custom style library targeting .net8.0, the following code is generated:
In .NET 9, the
SetAndLoadSource
was changed to internal here, which causes this generated code to fail when referencing the assembly from a nuget package (for some reason I don't quite understand, it doesn't happen with project reference).If you target .NET 8, the crash does not occur. This change was a breaking binary change that caused a regression. It's probably better to just mark the method non-browsable.
Steps to Reproduce
Link to public reproduction project repository
No response
Version with bug
9.0.12 SR1.2
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
8.0.100 SR10
Affected platforms
Android, Windows, macOS, iOS, Other (Tizen, Linux, etc. not supported by Microsoft directly)
Affected platform versions
No response
Did you find any workaround?
Add net9 target to class library and reference 9.0.0 of
Microsoft.Maui.Controls
. This only works if you have access to that library though.Relevant log output
The text was updated successfully, but these errors were encountered: