-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Add more type-forwarders for Xamarin.Android compatibility to mscorlib.dll #82618
Conversation
…b.dll The legacy Xamarin.Android version of mscorlib.dll differed a bit compared to the .NET Framework mscorlib.dll, mostly because of additions for .NET Standard 2.1 support. This meant that an assembly which was compiled against that mscorlib expects types there but since we didn't have type-forwarders in our mscorlib.dll shim to point them to the right assembly you'd get a TypeLoadException when running on modern .NET 6 Android. Fixes dotnet#82193 Should also fix dotnet/maui#5142, dotnet/maui#5078, dotnet/maui#3903
Tagging subscribers to this area: @dotnet/area-infrastructure-libraries Issue DetailsThe legacy Xamarin.Android version of mscorlib.dll differed a bit compared to the .NET Framework mscorlib.dll, mostly because of additions for .NET Standard 2.1 support. This meant that an assembly which was compiled against that mscorlib expects types there but since we didn't have type-forwarders in our mscorlib.dll shim to point them to the right assembly you'd get a TypeLoadException when running on modern .NET 6 Android. Fixes #82193 Should also fix these MAUI issues: dotnet/maui#5142, dotnet/maui#5078, dotnet/maui#3903
|
Thanks, @akoeplinger . I support this PR 🖖 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with this change in principle. Needs a little work though.
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
Is this setting a precedent to workaround the historical mistake in System.Drawing facades in Mono (mono/mono#21239)? |
Hi, when can we expect the release of this fix once this is merged? |
@filipnavara theoretically, but my understanding is that is much less common since it was mostly an issue on iOS which isn't compatible anyway. |
It's issue for both Android and iOS. We run some debugging/profiling scenarios with net6.0-ios/android + Xamarin.Forms. The issue with the System.Drawing types basically turns this scenario into "recompile the whole world" scenario because nearly all the 3rd-party Xamarin.Forms-dependent libraries suffer from the problem. |
@filipnavara would you mind filing an issue with the concrete types that are affected? |
Sure. |
@akoeplinger do you think we should backport this to 7? |
@akoeplinger can we also backport this to dotnet 6? |
We currently don't plan to do that since .NET 6 is only supported until May 2023 specifically for MAUI apps (6 months after .NET 7 release according to https://dotnet.microsoft.com/en-us/platform/support/policy/maui) so it would only apply for a very short time. |
But still, this hotfix should apply to the apps that are using .Net 6 right? |
…b.dll (dotnet#82618) The legacy Xamarin.Android version of mscorlib.dll differed a bit compared to the .NET Framework mscorlib.dll, mostly because of additions for .NET Standard 2.1 support. This meant that an assembly which was compiled against that mscorlib expects types there but since we didn't have type-forwarders in our mscorlib.dll shim to point them to the right assembly you'd get a TypeLoadException when running on modern .NET 6 Android. Fixes dotnet#82193 (cherry picked from commit d8203e7)
…ity to mscorlib.dll and System.Drawing.Common.dll (#83137) * Add more type-forwarders for Xamarin.Android compatibility to mscorlib.dll (#82618) The legacy Xamarin.Android version of mscorlib.dll differed a bit compared to the .NET Framework mscorlib.dll, mostly because of additions for .NET Standard 2.1 support. This meant that an assembly which was compiled against that mscorlib expects types there but since we didn't have type-forwarders in our mscorlib.dll shim to point them to the right assembly you'd get a TypeLoadException when running on modern .NET 6 Android. Fixes #82193 (cherry picked from commit d8203e7) * Add type-forwarders for Xamarin.Android compatibility to System.Drawing.Common.dll (#82839) The legacy Xamarin.Android version of System.Drawing.Common.dll contained these types, add forwarders so we don't get a TypeLoadException when using an assembly compiled against that in modern .NET Android. Fixes #82829 (cherry picked from commit e486f38) * Use 7.0 version of the ApiCompat suppressions * Fix diff --------- Co-authored-by: Carlos Sánchez López <1175054+carlossanlop@users.noreply.github.com>
The legacy Xamarin.Android version of mscorlib.dll differed a bit compared to the .NET Framework mscorlib.dll, mostly because of additions for .NET Standard 2.1 support.
This meant that an assembly which was compiled against that mscorlib expects types there but since we didn't have type-forwarders in our mscorlib.dll shim to point them to the right assembly you'd get a TypeLoadException when running on modern .NET 6 Android.
Fixes #82193
Should also fix these MAUI issues: dotnet/maui#5142, dotnet/maui#5078, dotnet/maui#3903