Clarify TargetFramework as TFM alias and document SDK 10.0.300 multi-TFM equivalence#52883
Clarify TargetFramework as TFM alias and document SDK 10.0.300 multi-TFM equivalence#52883
Conversation
Agent-Logs-Url: https://github.com/dotnet/docs/sessions/fd388405-b14a-4f14-ab50-18f84128f21a Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the .NET SDK MSBuild property reference to clarify how TargetFramework/TargetFrameworks values are interpreted, including noting that the SDK parses TFMs into other derived MSBuild properties, and documenting a .NET SDK 10.0.300 multi-targeting equivalence behavior.
Changes:
- Added a note under
TargetFrameworkexplaining that the SDK parses the value and populates related MSBuild properties. - Added a note under
TargetFrameworksabout .NET SDK 10.0.300 allowing multiple entries that resolve to the same effective framework.
| ``` | ||
|
|
||
| > [!NOTE] | ||
| > Starting with .NET SDK 10.0.300, multiple values can resolve to the same effective framework. For example, `<TargetFrameworks>linux;mac</TargetFrameworks>` is valid where both aliases resolve to `net10.0` as the target framework. |
There was a problem hiding this comment.
The example <TargetFrameworks>linux;mac</TargetFrameworks> uses values that aren’t listed as supported TFMs in docs/standard/frameworks.md (for example, the OS-specific form is net10.0-macos, not mac, and there’s no linux TFM). As written, the note is likely to confuse readers and suggests an invalid configuration. Please update the example and wording to use supported TFM forms (and make sure it matches the scenario you intend to document about multiple entries resolving to the same effective target framework).
| > Starting with .NET SDK 10.0.300, multiple values can resolve to the same effective framework. For example, `<TargetFrameworks>linux;mac</TargetFrameworks>` is valid where both aliases resolve to `net10.0` as the target framework. | |
| > Starting with .NET SDK 10.0.300, multiple values can resolve to the same effective target framework. For example, `<TargetFrameworks>net10.0-windows;net10.0-windows7.0</TargetFrameworks>` is valid because both entries resolve to the same effective target framework. |
The
TargetFramework/TargetFrameworksMSBuild property docs didn't explain that these values are aliases the SDK translates into canonical moniker properties, nor the SDK 10.0.300 behavior where multipleTargetFrameworksvalues can resolve to the same effective framework.Changes to
msbuild-props.mdTargetFramework: Adds a note that the value is an alias — the .NET SDK parses it and setsTargetFrameworkMoniker,TargetFrameworkIdentifier,TargetFrameworkVersion, and (when applicable)TargetPlatformIdentifier,TargetPlatformVersion, andTargetPlatformMoniker. Notes that users can set these properties directly when using a custom alias.TargetFrameworks: Adds a note that starting with .NET SDK 10.0.300, multiple values can resolve to the same effective framework — for example:Both
net10.0-linuxandnet10.0-macresolve tonet10.0.Internal previews