question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet restore no longer supports multiple runtimes

See original GitHub issue

Repo

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:open
  • Created 4 years ago
  • Reactions:17
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
DamienDennehycommented, Mar 4, 2022

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.

1reaction
mrhelmutcommented, Jun 27, 2022

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 the project.assets.json and building will not work because restore assumes that the project is up-to-date despite missing the asked RID in the latest restore 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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found