Support building for multiple RIDs, similar to how TargetFrameworks works
See original GitHub issueSteps to reproduce
Have project file
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;netcoreapp2.0</TargetFrameworks>
<RuntimeIdentifiers>win;linux-x64</RuntimeIdentifiers>
</PropertyGroup>
</Project>
run dotnet build
Expected behavior
Builds .dlls, that is the cross join between the RuntimeIdentifiers and TargetFrameworks
Actual behavior
Tries to build the any rid for each framework in TargetFrameworks but can’t because the any
rid is unbuildable on this project.
Environment data
dotnet --info
output:
.NET Core SDK (reflecting any global.json): Version: 2.1.302 Commit: 9048955601
Runtime Environment: OS Name: debian OS Version: 9 OS Platform: Linux RID: debian.9-x64 Base Path: /usr/share/dotnet/sdk/2.1.302/
Host (useful for support): Version: 2.1.2 Commit: 811c3ce6c0
.NET Core SDKs installed: 2.1.302 [/usr/share/dotnet/sdk]
.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
@onovotny: I tried your MSBuild.Sdk.Extras version 1.6.30-preview and 1.7.1-preview; however while it can make a reference assembly just fine it doesn’t seem to convince dotnet build
or dotnet pack
to do the right thing with RuntimeIdentifiers. 1.6.40 seems to be brain-damaged and the builds bomb.
dotnet /usr/share/dotnet/sdk/2.1.302/MSBuild.dll
doesn’t work either.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:10
- Comments:12 (9 by maintainers)
Top GitHub Comments
This is a valid scenario.
I’d argue that on desktop platforms, it also makes sense to have, e.g.
<RuntimeIdentifiers>osx-x64;linux-x64</RuntimeIdentifiers>
, so that I can get multiple executables, one for each RID, with a singledotnet publish
. Of course, I can rundotnet publish -r
multiple times, but it’s more desirable to have it built into the build system.The scenario could be interesting for how things will change in “.NET 5”…
No idea how/if TFMs are going to evolve but I could also easily see a world where we could do
or something similar instead of
monoandroid60
and friends. (though I don’t think this would be RIDs)