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

Resolve unknown platform name warnings #50193

Merged
merged 11 commits into from
Mar 31, 2021

Conversation

buyaa-n
Copy link
Contributor

@buyaa-n buyaa-n commented Mar 24, 2021

Fixes #49323, Related to #45851

Now we have a new analyzer "Referring to unknown platform names should result in warnings" which validate platform name and version of SupportedOSPlatform, UnupportedOSPlatform attributes parameter and warn accordingly. By running the analyzer in runtime found dozens of warnings mostly on attributes generated in AssemblyInfo.cs file added by the target platforms, see #49323 for more details. This PR:

  1. updates analyzer version to dogfood that analyzer
  2. fixes the unknows platform names by adding them into MSBuild SupportedPlatforms list
  3. Restrict UnsupportedOSPlatform("browser") attribute on .net framework, add name "browser" into MSBuild SupportedPlatforms list for netstandard and netcoreapp buiilds
  4. Generate version less attributes by TFM target as some platforms not expected to have versions
  5. Add [UnsupportedOSPlatform("browser")] attribute only for NetCoreApp

@ghost
Copy link

ghost commented Mar 24, 2021

Tagging subscribers to this area: @tarekgh, @tommcdon, @pjanotti
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes #49323, Related to #45851

Now we have a new analyzer "Referring to unknown platform names should result in warnings" which validate platform name and version of SupportedOSPlatform, UnupportedOSPlatform attributes parameter and warn accordingly. By running the analyzer in runtime found dozens of warnings mostly on attributes generated in AssemblyInfo.cs file added by the target platforms, see #49323 for more details. This PR:

  1. updates analyzer version to dogfood that analyzer
  2. fixes the unknows platform names by adding them into MSBuild SupportedPlatforms list
  3. Restrict UnsupportedOSPlatform("browser") attribute on .net framework, add name "browser" into MSBuild SupportedPlatforms list for netstandard and netcoreapp buiilds
  4. Generate version less attributes by TFM target as some platforms not expected to have versions
  5. Add [UnsupportedOSPlatform("browser")] attribute only for NetCoreApp
Author: buyaa-n
Assignees: -
Labels:

area-System.Diagnostics.Tracing

Milestone: -

@ghost
Copy link

ghost commented Mar 24, 2021

Tagging subscribers to this area: @Anipik, @safern, @ViktorHofer
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes #49323, Related to #45851

Now we have a new analyzer "Referring to unknown platform names should result in warnings" which validate platform name and version of SupportedOSPlatform, UnupportedOSPlatform attributes parameter and warn accordingly. By running the analyzer in runtime found dozens of warnings mostly on attributes generated in AssemblyInfo.cs file added by the target platforms, see #49323 for more details. This PR:

  1. updates analyzer version to dogfood that analyzer
  2. fixes the unknows platform names by adding them into MSBuild SupportedPlatforms list
  3. Restrict UnsupportedOSPlatform("browser") attribute on .net framework, add name "browser" into MSBuild SupportedPlatforms list for netstandard and netcoreapp buiilds
  4. Generate version less attributes by TFM target as some platforms not expected to have versions
  5. Add [UnsupportedOSPlatform("browser")] attribute only for NetCoreApp
Author: buyaa-n
Assignees: -
Labels:

area-Infrastructure-libraries, area-System.Diagnostics.Tracing

Milestone: -

eng/targetframeworksuffix.props Show resolved Hide resolved
eng/versioning.targets Outdated Show resolved Hide resolved
eng/versioning.targets Outdated Show resolved Hide resolved
Copy link
Member

@jeffhandley jeffhandley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a request for a new comment to be added; otherwise, approved.

eng/targetframeworksuffix.props Show resolved Hide resolved
eng/versioning.targets Outdated Show resolved Hide resolved
eng/versioning.targets Outdated Show resolved Hide resolved
@buyaa-n buyaa-n requested a review from safern March 29, 2021 22:20
Copy link
Member

@carlossanlop carlossanlop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I'd like @safern / @ViktorHofer / @Anipik to help confirm the infra changes are fine.

eng/versioning.targets Outdated Show resolved Hide resolved
eng/versioning.targets Show resolved Hide resolved
eng/versioning.targets Outdated Show resolved Hide resolved
@buyaa-n buyaa-n merged commit 09f075f into dotnet:main Mar 31, 2021
@buyaa-n buyaa-n deleted the resolve_invalid_platforms branch April 25, 2021 20:12
@karelz karelz added this to the 6.0.0 milestone May 20, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jun 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Platform names correctness analyzer fails for OSPlatform attributes added in AssemblyInfo.cs file
6 participants