fsprojects / Paket

A dependency manager for .NET with support for NuGet packages and Git repositories.
https://fsprojects.github.io/Paket/
MIT License
2.02k stars 525 forks source link

Running paket as a dotnet tool from dotnet 6.0.202 results in an error HRESULT: 0x80004005 #4147

Open 7sharp9 opened 2 years ago

7sharp9 commented 2 years ago

Description

running paket from dotnet 6 results in an error HRESULT: 0x80004005

Repro steps

Have paket as a local tool in a repo, then:

dotnet tool restore
dotnet paket restore

Expected behavior

paket runs ok

Actual behavior

paket crashes with the following:

➜ dotnet paket
Failed to initialize CoreCLR, HRESULT: 0x80004005
(base) myriad on 🌱 master [$!] .NET v6.0.202

Known workarounds

Apparently you can replace the dotnet CLI from dotnet6 with the one from dotnet5 see: https://github.com/dotnet/sdk/issues/24648

Other info

OS: macOS Monterey 12.3.1 sdk installed: dotnet 6.0.202 only

7sharp9 commented 2 years ago

I have removed all versions of dotnet with the uninstall tool then solely installed dotnet 6.0.202

7sharp9 commented 2 years ago
  "tools": {
    "paket": {
      "version": "7.1.5",
      "commands": [
        "paket"
      ]
    },
7sharp9 commented 2 years ago

Also tried on all versions of paket 6.x, all exhibit same error.

jberzy commented 2 years ago

I fixed my problem with this by (re)installing dotnet 5 after installing 6.

baronfel commented 2 years ago

While the SDK/Runtime issue is being investigated, (putting my SDK hat on) I'd recommend that Paket update its TFM from netcoreapp2.1 to at least netcoreapp3.1. 2.1 runtimes aren't in support anymore, and 3.1 is in support until December of this year, so you're less likely to get a 'you're holding it wrong' answer from the team if you're targeting a supported runtime.

7sharp9 commented 2 years ago

I updated my runtimes to: framework: net60, netstandard21, netcoreapp31 but only for compatibility for those using myriad from those targets, nothing I need is tied to those.

7sharp9 commented 2 years ago

@baronfel I have the myriad CLI set as: <TargetFrameworks>net6.0;netcoreapp3.1</TargetFrameworks> I guess the netcoreapp3.1 is only needed for older consumers of the CLI tool. I forget the details after a few months :-(