dotnet restore no longer supports multiple runtimes
See original GitHub issueRepo
dotnet new console
dotnet restore -r win-x64 -r linux-x64
Result
error NETSDK1083: The specified RuntimeIdentifier 'win-x64;linux-x64' is not recognized.
Speculation It seems the multiple runtimes are being passed in as RuntimeIdentifier instead of RuntimeIdentifiers?
This used to work on 2.2
As a workaround I can put <RuntimeIdentifiers>....
in the csproj and exclude the -r
switches, but I dont really want to do this, since it means updating a lot of csprojs.
PS: I tried to find the cause for this, but got lost finding the source responsible for the dotnet restore
command 😦
Issue Analytics
- State:
- Created 4 years ago
- Reactions:17
- Comments:5 (1 by maintainers)
Top Results From Across the Web
dotnet restore command - .NET CLI
Specifies a runtime for the package restore. This is used to restore packages for runtimes not explicitly listed in the <RuntimeIdentifiers> tag ...
Read more >Runtime-specific apps no longer self-contained - .NET
Learn about a breaking change in the .NET 8 SDK where apps that specify a runtime identifier are no longer self-contained by default....
Read more >Publish ReadyToRun with --no-restore requires changes
Learn about the breaking change in .NET 6 where publishing a project with ReadyToRun requires changes to the way the project is restored....
Read more >dotnet publish command - .NET CLI
Publishes the application for a given runtime. For a list of Runtime Identifiers (RIDs), see the RID catalog. For more information, see .NET...
Read more >dotnet build command - .NET CLI
This command supports the dotnet restore options when passed in the long form (for example, --source ). Short form options, such as -s ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Also surprised to see this as still an issue, and on the docs in 2022 https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-restore
Using Sdk 5.0.303.
Stumbled upon this documentation for
dotnet restore
while trying to restore multiple RIDs at once, which lead me here. Still up as of SDK 6.I assume that the suggested way to restore multiple RIDs without adding them to the csproj explicitly is to
restore
each RID before building for that RID? (e.g.restore ... ; build ... ; restore ... ; build ...
)If that is so, it seems that calling
restore
before each build steps sometimes loose RIDs in theproject.assets.json
and building will not work becauserestore
assumes that the project is up-to-date despite missing the asked RID in the latestrestore
call. Though this is likely not related to this issue directly (if it is intended to restore RIDs individually before building, I’ll try to figure out a repro and open another issue).