Skip to content

Commit 91e77d8

Browse files
committed
Incorp feedback
1 parent c4da8f2 commit 91e77d8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docs/msbuild/net-sdk-multitargeting.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,13 @@ RIDs are specified using the `<RuntimeIdentifier>` property in the project file.
124124

125125
For .NET Core projects, target frameworks and target runtimes specified as RIDs act separately, and may be used in any supported combination, including multiple RIDs and multiple target frameworks. For a .NET Framework target, you can only specify a single RID.
126126

127-
The RID affects the NuGet packages your application binaries depend on, but the binary itself only depends on the target framework. Therefore, although separate output folders are created for each different target framework (for example, `bin\Debug\netstandard2.0` and `bin\Debug\net8.0`), they are not created for each RID.
127+
There's a distinction between a build that is inherently independent of RID (by specifying `RuntimeIdentifiers`) and a build that targets an RID (by specifying `RuntimeIdentifier` or by using the `-r` option with the `dotnet` CLI).
128+
129+
If you specify `RuntimeIdentifiers`, the RID affects the NuGet packages your application binaries depend on, but the binary itself only depends on the target framework. Therefore, in this scenario, although separate output folders are created for each different target framework (for example, `bin\Debug\netstandard2.0` and `bin\Debug\net8.0`), they are not created for each RID.
130+
131+
Specifying `RuntimeIdentifiers` does not inherently mean each build or publish operation targets each of the RIDs that are specified. Instead, it signals to NuGet Restore the set of RID-specific NuGet packages that need to be downloaded during a restore operation. This means that it's feasible to do `dotnet restore` and `dotnet publish -r linux-x64 --no-restore` to download the correct runtime packages for the RID you specify.
132+
133+
If a single RuntimeIdentifier is specified (either via `-r` on the CLI or setting the `RuntimeIdentifier` property in an MSBuild project file), then most operations become platform-specific, including `dotnet publish` and `dotnet build`. In this case, the output paths and several other MSBuild properties are modified. For example, the output directory of a build with a single RID will have the RID appended: `bin\Debug\<TFM>\<RID>`.
128134

129135
## Comparison Between .NET Framework and .NET Core Multitargeting
130136

0 commit comments

Comments
 (0)