Skip to content

Implicit architecture targeting not in place for dotnet tool install #21660

@richlander

Description

@richlander

The spec talks about implicit RID targeting.

From that doc, these are the implicit RIDs:

  • .NET 6: osx-arm64
  • .NET 5: osx-x64
  • .NET Core 3.1: osx-x64

Not documented, on Windows these would be slightly different:

  • .NET 6: win-arm64
  • .NET 5: win-arm64
  • .NET Core 3.1: win-x64

My environment:

rich@MacBook-Air-M1-2020 app % dotnet --info | grep RID
RID: osx-arm64
rich@MacBook-Air-M1-2020 app % dotnet --version
6.0.100-rc.2.21478.25

This is working, AFAICT, for dotnet run.

rich@MacBook-Air-M1-2020 app % cat app.csproj | grep Target
<TargetFramework>net5.0</TargetFramework>
rich@MacBook-Air-M1-2020 app % dotnet run
/Users/rich/app/app.csproj : error NU1102: Unable to find package Microsoft.NETCore.App.Host.osx-x64 with version (= 5.0.11)
/Users/rich/app/app.csproj : error NU1102: - Found 2021 version(s) in dotnet6 [ Nearest version: 6.0.0-alpha.1.20423.5 ]
/Users/rich/app/app.csproj : error NU1102: - Found 62 version(s) in nuget.org [ Nearest version: 6.0.0-preview.1.21102.12 ]
/Users/rich/app/app.csproj : error NU1102: - Found 1 version(s) in internal [ Nearest version: 6.0.0-rc.2.21474.18 ]

The build failed. Fix the build errors and run again.

That's failing, but due to a mismatch in versions available on the feeds I have registered, so NP. The key thing is that the CLI is asking for the osx-x64 package, which is the desired one.

Let's look at dotnet tool install in contrast.

rich@MacBook-Air-M1-2020 app % dotnet tool install -g dotnet-serve
You can invoke the tool using the following command: dotnet-serve
Tool 'dotnet-serve' (version '1.9.71') was successfully installed.
rich@MacBook-Air-M1-2020 app % dotnet-serve 
zsh: killed     dotnet-serve
rich@MacBook-Air-M1-2020 app % codesign -s - ~/.dotnet/tools/dotnet-serve 
rich@MacBook-Air-M1-2020 app % dotnet-serve                              
It was not possible to find any compatible framework version
The framework 'Microsoft.AspNetCore.App', version '5.0.0' (arm64) was not found.
  - The following frameworks were found:
      6.0.0-rc.2.21470.37 at [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
      6.0.0-rc.2.21475.12 at [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]

You can resolve the problem by installing the specified framework and/or SDK.

The specified framework can be found at:
  - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.AspNetCore.App&framework_version=5.0.0&arch=arm64&rid=osx.11.1-arm64
rich@MacBook-Air-M1-2020 app % 

It is pretty obvious that this isn't a good situation. The user needs to know a-priori that dotnet-serve needs to be installed with -a x64. We can and should do that automatically, matching dotnet run behavior.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions