Skip to content

.NET local tool install not working with .NET 8 RC2 SDK #36539

Closed

Description

@martincostello

Describe the bug

Attempting to install a .NET local tool with the .NET 8 RC2 SDK apparently succeeds, but then when trying to run the tool the command fails and the user is prompted to run dotnet tool install.

$ dotnet tool restore
Skipping NuGet package signature verification.
Tool 'docfx' (version '2.72.0') was restored. Available commands: docfx

Restore was successful.
$ dotnet docfx --version
Run "dotnet tool restore" to make the "docfx" command available.

To Reproduce

A self-contained repro repository using GitHub Actions can be found at https://github.com/martincostello/docfx-dotnet-8-repro.

Exceptions (if any)

None.

Further technical details

$ dotnet --info
.NET SDK:
 Version:   8.0.100-rc.2.23502.2
 Commit:    0abacfc2b6

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  22.04
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /usr/share/dotnet/sdk/8.0.100-rc.2.23502.2/

.NET workloads installed:
There are no installed workloads to display.

Host:
  Version:      8.0.0-rc.2.23479.6
  Architecture: x64
  Commit:       0b25e38ad3

.NET SDKs installed:
  6.0.416 [/usr/share/dotnet/sdk]
  7.0.113 [/usr/share/dotnet/sdk]
  7.0.203 [/usr/share/dotnet/sdk]
  7.0.310 [/usr/share/dotnet/sdk]
  7.0.403 [/usr/share/dotnet/sdk]
  8.0.100-rc.2.23502.2 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.24 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.5 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.13 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.0-rc.2.23480.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.24 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.5 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.13 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.0-rc.2.23479.6 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  DOTNET_ROOT       [/usr/share/dotnet]

global.json file:
  /home/runner/work/docfx-dotnet-8-repro/docfx-dotnet-8-repro/global.json

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Activity

  1. ghost added
    untriaged
    on Oct 28, 2023
  2. martincostello commented on Oct 28, 2023

    @martincostello
    MemberAuthor

    Also appears to fail with a global tool: error.

  3. martincostello commented on Oct 29, 2023

    @martincostello
    MemberAuthor

    Also tried dotnet tool run docfx and running dotnet tool restore a second time and neither work.

    Running dotnet tool --list after restore shows it is installed:

    $ dotnet tool --list
    Package Id      Version      Commands      Manifest                                                                             
    --------------------------------------------------------------------------------------------------------------------------------
    docfx           2.72.0       docfx         /home/runner/work/docfx-dotnet-8-repro/docfx-dotnet-8-repro/.config/dotnet-tools.json
    
  4. martincostello commented on Oct 30, 2023

    @martincostello
    MemberAuthor

    For my specific use case I've been able to workaround the issue by executing the tool directly from where it's restored to:

    $target = "net8.0"
    $version = (Get-Content ".config/dotnet-tools.json" | Out-String | ConvertFrom-Json).tools.docfx.version
    $docfx = Join-Path ($env:USERPROFILE ?? "~") ".nuget" "packages" "docfx" $version "tools" $target "any" "docfx.dll"
    dotnet $docfx
  5. baronfel commented on Oct 30, 2023

    @baronfel
    Member

    Hey @martincostello - thanks for reporting. I see this is on Ubuntu - have you seen similar behavior on any other platforms?

  6. martincostello commented on Oct 30, 2023

    @martincostello
    MemberAuthor

    Looks like it's broken for macOS and Windows too in GitHub Actions: workflow run.

  7. baronfel commented on Oct 30, 2023

    @baronfel
    Member

    bizarre - at least on Windows docfx works for me on rc2, and Ubuntu 23.10 on WSL similarly worked on a 'install'. Yet the workflows you have clearly show failure.

  8. JL03-Yue commented on Oct 30, 2023

    @JL03-Yue
    Contributor

    @martincostello Could you try running without dotnet when running the tool? I'm looking into the problem

  9. dsplaisted commented on Oct 30, 2023

    @dsplaisted
    Member

    This look like it's probably caused by this RC2 known issue: https://github.com/dotnet/core/blob/main/release-notes/8.0/known-issues.md#-80100-rc2-dotnet-tool-restore-will-always-install-the-latest-version-of-a-specific-tool

    The repro specifies version 2.72.0 of the tool, but because of the bug the SDK restores the latest available version (2.72.1) instead. But then when the SDK goes to run the tool it is looking for 2.72.0 and can't find it. A workaround would be to update the tools manifest to use the latest version of the tool (2.72.1 right now).

  10. martincostello commented on Oct 30, 2023

    @martincostello
    MemberAuthor

    I'll try that now, but I think I opened this issue before the .1 release shipped on Friday, and then when I saw there was a newer version available I updated Polly and rebased my branch for .NET 8 there and it was still broken.

  11. martincostello commented on Oct 30, 2023

    @martincostello
    MemberAuthor

    Yep, that was it. It's fixed now.

    Must have been a very unfortunate sequence of timing that meant the new docfx release came out just as I fixed the issues we had in that branch and then I must not have rebased it to include the tool update in that branch until after I'd applied the workaround I posted earlier.

  12. removed
    untriaged
    on Oct 31, 2023
  13. self-assigned this
    on Oct 31, 2023
  14. marcpopMSFT commented on Oct 31, 2023

    @marcpopMSFT
    Member

    Thanks for confirming. Closing as fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions