[release/5.0-preview8] Mark Windows-specific APIs as such (#39265) #39657
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Port of #39265 into the
release/5.0-preview8
branch.Description
As part of the Platform Compatibility Analyzer feature set, this PR applies the new
[MinimumOSPlatform("windows-7.0")]
attribute to all Windows-specific APIs that shipped in or before .NET Core 3.1 and updates the project builds to indicate Windows-specific builds with a minimum version of 7.0.Customer Impact
The Platform Compatibility Analyzer itself is being finished up and is expected to ship in the Preview 8 SDK through the
roslyn-analyzers
repo. The attributes this PR uses already exist in the Preview 8 branch, as do theIsOSPlatformOrLater
andIsOSPlatformEarlierThan
methods. This PR allows those features and the analyzer to work together in Preview 8 so that customers can preview the experience when consuming Windows-specific APIs.Risk
Low. The only consumer of this metadata is the analyzer and the PR.