Skip to content
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

[generator] Disable [SupportedOSPlatform] until we can build with .NET 5/6. #781

Merged
merged 1 commit into from
Jan 14, 2021

Conversation

jpobst
Copy link
Contributor

@jpobst jpobst commented Jan 14, 2021

Context: dotnet/android#5497

We cannot currently build net5.0 or net6.0 assemblies in our XA tree and instead do some workaround that involves compiling with netcoreapp3.1 but referencing 5.0 BCL. This creates a conflict between the local [SupportedOSPlatform] we create in netcoreapp3.1 Mono.Android.dll, and the real one in the 5.0 BCL.

error CS0433: The type 'SupportedOSPlatformAttribute' exists in both 'Mono.Android, Version=0.0.0.0, 
Culture=neutral, PublicKeyToken=84e04ff9cfb79065' and 'System.Runtime, Version=5.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a' [/Users/runner/work/1/s/tests/Mono.Android-Tests/Java.Interop-Tests/
Java.Interop-Tests.NET.csproj] [/Users/runner/work/1/s/tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk
/Mono.Android.NET-Tests.csproj]

We will disable generating these attributes until we can build Mono.Android.dll with NET, in which case it will not contain the local attribute.

@jpobst jpobst marked this pull request as ready for review January 14, 2021 22:25
@jonpryor jonpryor merged commit 00862ad into master Jan 14, 2021
@jonpryor jonpryor deleted the disable-supportedplatform branch January 14, 2021 23:55
@jpobst jpobst added this to the 11.2 (16.10 / 8.10) milestone Feb 2, 2021
jpobst added a commit that referenced this pull request May 14, 2021
jonpryor pushed a commit that referenced this pull request May 17, 2021
…)" (#841)

Context: dotnet/android#5338

This reverts commit 00862ad.

Now that we are properly building with `$(TargetFramework)`=net6.0
(4d0cba6), we can re-enable the `[SupportedOSPlatform]` support,
as originally introduced in da12df4.

Emit the [`System.Runtime.Versioning.SupportedOSPlatformAttribute`][0]
custom attribute which is used to specify on which platforms and
platform versions an API is available.  This is used to build analyzers
to give users warnings if they are trying to use an API when it will
not be available on their target platform.

[0]: https://docs.microsoft.com/en-us/dotnet/api/system.runtime.versioning.supportedosplatformattribute?view=net-5.0
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants