-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[release/7.0] Add more type-forwarders for Xamarin.Android compatibil…
…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 <[email protected]>
- Loading branch information
1 parent
ac81828
commit 6eaaf26
Showing
5 changed files
with
122 additions
and
2 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
src/libraries/System.Drawing.Common/src/MatchingRefApiCompatBaseline.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# the following suppression are for back-compatibility with legacy Xamarin which had these types in System.Drawing.Common.dll | ||
|
||
TypesMustExist : Type 'System.Drawing.Color' does not exist in the reference but it does exist in the implementation. | ||
TypesMustExist : Type 'System.Drawing.KnownColor' does not exist in the reference but it does exist in the implementation. | ||
TypesMustExist : Type 'System.Drawing.Point' does not exist in the reference but it does exist in the implementation. | ||
TypesMustExist : Type 'System.Drawing.PointF' does not exist in the reference but it does exist in the implementation. | ||
TypesMustExist : Type 'System.Drawing.Rectangle' does not exist in the reference but it does exist in the implementation. | ||
TypesMustExist : Type 'System.Drawing.RectangleF' does not exist in the reference but it does exist in the implementation. | ||
TypesMustExist : Type 'System.Drawing.Size' does not exist in the reference but it does exist in the implementation. | ||
TypesMustExist : Type 'System.Drawing.SizeF' does not exist in the reference but it does exist in the implementation. |
14 changes: 14 additions & 0 deletions
14
src/libraries/System.Drawing.Common/src/System.Drawing.Common.Forwards.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
// This is required for back-compatibility with legacy Xamarin which had these types in System.Drawing.Common.dll | ||
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.Color))] | ||
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.ColorTranslator))] | ||
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.KnownColor))] | ||
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.Point))] | ||
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.PointF))] | ||
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.Rectangle))] | ||
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.RectangleF))] | ||
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.Size))] | ||
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.SizeF))] | ||
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.SystemColors))] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters