Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet restore no longer supports multiple runtimes #3843

Open
CumpsD opened this issue Oct 31, 2019 · 5 comments
Open

dotnet restore no longer supports multiple runtimes #3843

CumpsD opened this issue Oct 31, 2019 · 5 comments

Comments

@CumpsD
Copy link

CumpsD commented Oct 31, 2019

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 :(

@flcdrg
Copy link
Contributor

flcdrg commented Nov 25, 2019

Just hit the same problem trying to upgrade 2.2 to 3.0

Restoring with multiple RIDs is useful as it means things like building in containers can cache the dotnet restore layer properly, and then build for both platforms successfully.

rainersigwald pushed a commit that referenced this issue Jul 20, 2020
….18 (#3843)

- Microsoft.NET.Sdk - 3.1.200-preview.19613.18
@LanceMcCarthy
Copy link

LanceMcCarthy commented Apr 21, 2021

I'm quite surprised to see this is 18 months old.

In the docs:

image

In the latest SDK, if you run this command:

dotnet restore My.csproj  -r linux-arm64 -r linux-arm -r linux-x64

you get the following error:

C:\Program Files\dotnet\sdk\6.0.100-preview.3.21202.5\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(64,5): error NETSDK1083: The specified RuntimeIdentifier 'linux-arm64;linux-arm;linux-x64' is not recognized. [C:\Source\GitHub\TseExamples\ReportingOnLinux\ReportingOnLinux\ReportingOnLinux.csproj]
``

> The same is true for the `dotnet publish` command

@DamienDennehy
Copy link

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.

@mrhelmut
Copy link

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).

@benediktibk
Copy link

Just ran into the same issue:

dotnet restore --no-dependencies --runtime linux-x64 --runtime win-x64 blub.csproj
  Determining projects to restore...
/usr/share/dotnet/sdk/7.0.102/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(90,5): error NETSDK1083: The specified RuntimeIdentifier 'linux-x64;win-x64' is not recognized. [blub.csproj]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants