cross-platform-targeting: remove Xamarin/UWP-era graphics, modernize content#52995
cross-platform-targeting: remove Xamarin/UWP-era graphics, modernize content#52995
Conversation
…ze content Agent-Logs-Url: https://github.com/dotnet/docs/sessions/71bd78c1-5b1a-4904-a61e-ddd321aabd31 Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR modernizes the cross-platform targeting guidance by removing legacy Xamarin/UWP-era diagrams and updating the accompanying prose and sample code to reflect current .NET multi-targeting and Windows platform targeting.
Changes:
- Removed two outdated ecosystem/packaging diagrams from the article.
- Replaced the NuGet multi-targeting diagram with prose describing
netstandard2.0vsnet8.0asset selection. - Updated UWP references in prose and changed the sample preprocessor symbol from
WINDOWS_UWPtoWINDOWS.
Reviewed changes
Copilot reviewed 1 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| docs/standard/library-guidance/cross-platform-targeting.md | Removes outdated diagram references, updates UWP-era wording, adds updated multi-targeting explanation, and updates conditional compilation example. |
| docs/standard/library-guidance/media/cross-platform-targeting/platforms-netstandard.png | Deletes an outdated pre-.NET 5 ecosystem diagram. |
| docs/standard/library-guidance/media/cross-platform-targeting/nuget-package-multiple-assemblies.png | Deletes an outdated NuGet multi-targeting diagram. |
| #if NET462 || WINDOWS | ||
| return true; |
There was a problem hiding this comment.
Same issue as above: WINDOWS is only defined for OS-specific TFMs (for example, net8.0-windows). If the intent is to expose an IsSupported capability for the base net8.0 target, use a TFM symbol or a runtime OS check instead; otherwise, document that this property is only true when compiling for net*-windows.
There was a problem hiding this comment.
The same clarifying comment covers both GetCoordinatesAsync and IsSupported, since it's placed at the class level. Addressed in commit b979b9a.
| #elif WINDOWS | ||
| return CallWindowsApi(); |
There was a problem hiding this comment.
WINDOWS is a platform symbol that’s only defined when you target an OS-specific TFM (for example, net8.0-windows). As written, this conditional won’t compile into the Windows-specific branch for consumers targeting the base net8.0 TFM. Consider switching to a TFM symbol (for example, NET8_0_WINDOWS) or clarifying in the surrounding guidance that the library must target net*-windows for this branch to apply.
There was a problem hiding this comment.
Added a comment to the code example clarifying that WINDOWS is only defined when targeting an OS-specific TFM (for example, net8.0-windows). Addressed in commit b979b9a.
There was a problem hiding this comment.
@copilot Can you remove the code comment and use a TFM symbol instead?
There was a problem hiding this comment.
Removed the comment and replaced WINDOWS with NET8_0_WINDOWS in both #elif directives. Addressed in commit 0b221cb.
Agent-Logs-Url: https://github.com/dotnet/docs/sessions/8945da4a-5ae1-4f64-bffa-a0e4dae71baa Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
…e example Agent-Logs-Url: https://github.com/dotnet/docs/sessions/1d3c4398-c429-4805-b9a9-fd0557258836 Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
The article contained two diagrams showing a pre-.NET-5 ecosystem (Xamarin, .NET Core, UWP,
netcoreapp2.0) that no longer reflect current .NET. All UWP references in prose and code were also stale.Changes
platforms-netstandard.png,nuget-package-multiple-assemblies.png)netstandard2.0/net8.0assembly selection behaviorWINDOWS_UWP→NET8_0_WINDOWS(a TFM-based preprocessor symbol defined for thenet8.0-windowstarget)ms.dateInternal previews
Internal previews