-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
platform/ioss/needs-infoIssue needs more info from the authorIssue needs more info from the authort/bugSomething isn't workingSomething isn't working
Description
Description
Hi,
When building an iOS release configuration, XAML compilation fails with the following errors:
XamlC error XC0000: Cannot resolve type "http://schemas.microsoft.com/dotnet/2022/maui/toolkit:MediaElement".
XamlC error XC0000: Cannot resolve type "http://schemas.devexpress.com/maui:ChartView".
These errors occur even though the corresponding NuGet packages are referenced:
- CommunityToolkit.Maui.MediaElement
- DevExpress.Maui.Charts
- DevExpress.Maui.Core
The issue does not occur in Debug builds — only in Release (with AOT and trimming).
What i tried:
<PublishTrimmed>false>in csproj<TrimMode>copyused>,<IsTrimmable>false>,<EnableTrimAnalyzer>false>- Adding
<TrimmerRootAssembly>entries for all related libraries - Ensuring XML namespaces and XAML usage are correct
- Rebuilding clean Debug/Release, validating assemblies are present
- called fakemethods in the code behind files of the styles.xaml to actually use the types that i need. (like here)
Steps to Reproduce
- Create a new .NET MAUI project targeting iOS.
- Create a new .NET MAUI Class Library Project targeting iOS.
- Set Reference from class library to executed project (app)
- Add CommunityToolkit.Maui.MediaElement and/or DevExpress.Maui.Charts to class library
- change reference in main project to class library for styles
- Use a control like <toolkit:MediaElement /> or <dx:ChartView /> in a .xaml file.
- Build the project in Release mode for net9.0-ios.
- Observe the XamlC error XC0000 messages.
alternatively just build styles.xaml in sample repo in release build config.
Please help me i want to distribute my app asap.
If you tell me that encapsulation of resources like styles does not work, then tell me please.
Link to public reproduction project repository
https://github.com/maslewandowski/problemwithtrimmingmauiresources
Version with bug
9.0.70 SR7
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
IOS 18.4
Did you find any workaround?
No response
Relevant log output
source\repos\problemwithtrimmingmauiresources\styles\CommunityToolkitStyles.xaml(8,12): XamlC error XC0000: Cannot resolve type "http://schemas.microsoft.com/dotnet/2022/maui/toolkit:MediaElement".
1>Done building project "styles.csproj" -- FAILED.Metadata
Metadata
Assignees
Labels
platform/ioss/needs-infoIssue needs more info from the authorIssue needs more info from the authort/bugSomething isn't workingSomething isn't working