Skip to content

Link the platform compatibility analyzer article from OS platform API reference pages - #12993

Open
jeffhandley wants to merge 1 commit into
mainfrom
jeffhandley/platform-compat-docs-links
Open

Link the platform compatibility analyzer article from OS platform API reference pages#12993
jeffhandley wants to merge 1 commit into
mainfrom
jeffhandley/platform-compat-docs-links

Conversation

@jeffhandley

@jeffhandley jeffhandley commented Aug 16, 2026

Copy link
Copy Markdown
Member

Summary

Adds a See also link to the Platform compatibility analyzer conceptual article on the API reference pages for the OS platform attributes and System.OperatingSystem.

That article is the conceptual documentation for these APIs — it covers the platform name and version string formats, how CA1416 interprets the attributes, and which patterns count as platform guards — but none of the reference pages linked out to it.

Files touched (one <related> line each, in the type-level <Docs>):

  • System.Runtime.Versioning.OSPlatformAttribute
  • System.Runtime.Versioning.TargetPlatformAttribute
  • System.Runtime.Versioning.SupportedOSPlatformAttribute
  • System.Runtime.Versioning.UnsupportedOSPlatformAttribute
  • System.Runtime.Versioning.ObsoletedOSPlatformAttribute
  • System.Runtime.Versioning.SupportedOSPlatformGuardAttribute
  • System.Runtime.Versioning.UnsupportedOSPlatformGuardAttribute
  • System.OperatingSystem

System.Runtime.InteropServices.OSPlatform is intentionally excluded: the article doesn't mention it, and RuntimeInformation.IsOSPlatform isn't recognized by CA1416 as a platform guard, so the link would misdirect readers.

Follows up on a comment in dotnet/runtime#125181. These types set UseCompilerGeneratedDocXmlFile=false, so dotnet-api-docs is the source of truth for their docs and this is the correct repo for the change.


Internal previews

File Preview link
xml/System.Runtime.Versioning/ObsoletedOSPlatformAttribute.xml Preview published page
xml/System.Runtime.Versioning/OSPlatformAttribute.xml Preview published page
xml/System.Runtime.Versioning/SupportedOSPlatformAttribute.xml Preview published page
xml/System.Runtime.Versioning/SupportedOSPlatformGuardAttribute.xml Preview published page
xml/System.Runtime.Versioning/TargetPlatformAttribute.xml Preview published page
xml/System.Runtime.Versioning/UnsupportedOSPlatformAttribute.xml Preview published page
xml/System.Runtime.Versioning/UnsupportedOSPlatformGuardAttribute.xml Preview published page
xml/System/OperatingSystem.xml Preview published page

… docs

Adds a See also entry pointing to /dotnet/standard/analyzers/platform-compat-analyzer on the type-level docs for the OS platform attributes and System.OperatingSystem. That article is the conceptual documentation for these APIs, including the platform name and version string formats, but none of the reference pages linked to it.

Follow-up to a comment on dotnet/runtime#125181.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 16, 2026 06:37
@jeffhandley
jeffhandley requested a review from a team as a code owner August 16, 2026 06:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a See also (ECMA XML <related>) link from OS platform API reference pages to the Platform compatibility analyzer conceptual article, so readers can easily discover the authoritative guidance on platform name/version formats, CA1416 behavior, and platform guard patterns.

Changes:

  • Linked /dotnet/standard/analyzers/platform-compat-analyzer from System.OperatingSystem.
  • Linked the same conceptual article from the OS platform attribute and guard attribute reference pages.
  • Kept the change localized to a single <related> entry per type-level <Docs> section.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
xml/System/OperatingSystem.xml Adds a <related> article link to the platform compatibility analyzer.
xml/System.Runtime.Versioning/OSPlatformAttribute.xml Adds a <related> article link to the platform compatibility analyzer.
xml/System.Runtime.Versioning/TargetPlatformAttribute.xml Adds a <related> article link to the platform compatibility analyzer.
xml/System.Runtime.Versioning/SupportedOSPlatformAttribute.xml Adds a <related> article link to the platform compatibility analyzer.
xml/System.Runtime.Versioning/UnsupportedOSPlatformAttribute.xml Adds a <related> article link to the platform compatibility analyzer.
xml/System.Runtime.Versioning/ObsoletedOSPlatformAttribute.xml Adds a <related> article link to the platform compatibility analyzer.
xml/System.Runtime.Versioning/SupportedOSPlatformGuardAttribute.xml Adds a <related> article link to the platform compatibility analyzer.
xml/System.Runtime.Versioning/UnsupportedOSPlatformGuardAttribute.xml Adds a <related> article link to the platform compatibility analyzer.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants