You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to debug from the IDE with NativeAOT enabled the build fails with the following errors:
/Users/hughesd/Work/hydra-src/apps/Xamarin-PTToX/src/Pttox.Forms/obj/Debug/net9.0-ios/ios-arm64/Microsoft.VisualStudio.HotReload.MobileTapInitializer/Microsoft.VisualStudio.HotReload.MobileTapInitializer.ModuleInitializerGenerator/HotReloadMobileTapInitializer.g.cs(48,33): error IL2026: Using member 'System.Reflection.Assembly.GetType(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed by trimming. If the type name is a string literal, consider using Type.GetType instead.
/Users/hughesd/Work/hydra-src/apps/Xamarin-PTToX/src/Pttox.Forms/obj/Debug/net9.0-ios/ios-arm64/Microsoft.VisualStudio.HotReload.MobileTapInitializer/Microsoft.VisualStudio.HotReload.MobileTapInitializer.ModuleInitializerGenerator/HotReloadMobileTapInitializer.g.cs(55,33): error IL2075: 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicMethods' in call to 'System.Type.GetMethod(String, BindingFlags)'. The return value of method 'System.Reflection.Assembly.GetType(String)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
Steps to Reproduce
Create a maui project targetting iOS dotnet new maui
It looks like the code we inject when using Hot Restart isn't trimmer safe, so when the trimmer warnings are automatically enabled (which happens when NativeAOT is enabled), the build emits trimmer warnings (and I also assume you're building with warnings-as-errors).
Conditionally enabling NativeAOT might do as a workaround:
Apple platform
iOS
Framework version
net9.0-*
Affected platform version
Maui 9.0.21, vscode 1.95.3, .net maui vscode extension 1.6.16, dotnet 9.0.101, maui workload 9.0.0/9.0.100
Description
When trying to debug from the IDE with NativeAOT enabled the build fails with the following errors:
Steps to Reproduce
dotnet new maui
-> hot reload trimming errors occur as per description above
Did you find any workaround?
No
Build logs
No response
The text was updated successfully, but these errors were encountered: