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 command does not honor "globalPackagesFolder" in nuget.config file #39874

Open
WenningQiu opened this issue Mar 28, 2024 · 2 comments
Open
Assignees
Labels
Area-Tools good first issue Issues that would be a good fit for someone new to the repository. Narrow in scope, well-defined. new-hire-issue
Milestone

Comments

@WenningQiu
Copy link

WenningQiu commented Mar 28, 2024

Describe the bug

I use globalPackagesFolder in my nuget.config file to specify a non-default package cache directory. The dotnet tool restore command successfully restores the tool package to the specified package cache directory; however, the attempt to run the tool fails due to not able to find the tool package.

To Reproduce

  • Create nuget.config with the content below:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <config>
    <add key="globalPackagesFolder" value="C:\Cache\.nuget-integration\packages" />
  </config>
</configuration>
  • Create .config\dotnet-tools.json file with the content below:
{
  "version": 1,
  "isRoot": true,
  "tools": {
    "dotnet-rpm": {
      "version": "0.1.220",
      "commands": [
        "dotnet-rpm"
      ]
    }
  }
}
  • Run dotnet tool restore command. Below is the output I get:
C:\work\git\infra>dotnet tool restore
Tool 'dotnet-rpm' (version '0.1.220') was restored. Available commands: dotnet-rpm

Restore was successful.
  • Run dotnet rpm command. Below is the output I get:
C:\work\git\infra>dotnet rpm
Run "dotnet tool restore" to make the "dotnet-rpm" command available.
  • Delete nuget.config and run dotnet tool restore (which restores the tool package to the default package cache directory), then dotnet rpm will go through. (It will crash due to missing critical arguments, but that is not the concern here.)

Further technical details

  • Include the output of dotnet --info
C:\work\git\infra>dotnet --info
.NET SDK:
 Version:           8.0.100
 Commit:            57efcf1350
 Workload version:  8.0.100-manifests.8d38d0cc

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19044
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\8.0.100\

.NET workloads installed:
 Workload version: 8.0.100-manifests.8d38d0cc
 [maui-windows]
   Installation Source: VS 17.8.34330.188
   Manifest Version:    8.0.3/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maui\8.0.3\WorkloadManifest.json
   Install Type:              Msi

 [maccatalyst]
   Installation Source: VS 17.8.34330.188
   Manifest Version:    17.0.8478/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maccatalyst\17.0.8478\WorkloadManifest.json
   Install Type:              Msi

 [ios]
   Installation Source: VS 17.8.34330.188
   Manifest Version:    17.0.8478/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.ios\17.0.8478\WorkloadManifest.json
   Install Type:              Msi

 [android]
   Installation Source: VS 17.8.34330.188
   Manifest Version:    34.0.43/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.android\34.0.43\WorkloadManifest.json
   Install Type:              Msi


Host:
  Version:      8.0.0
  Architecture: x64
  Commit:       5535e31a71

.NET SDKs installed:
  6.0.419 [C:\Program Files\dotnet\sdk]
  8.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found

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

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

  • The IDE (VS / VS Code/ VS4Mac) you're running on, and its version
    VS2022. But the issue is not related to IDE.
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Tools untriaged Request triage from a team member labels Mar 28, 2024
@nagilson nagilson added needs team triage Requires a full team discussion and removed untriaged Request triage from a team member labels Apr 30, 2024
@marcpopMSFT marcpopMSFT removed the needs team triage Requires a full team discussion label May 7, 2024
@marcpopMSFT marcpopMSFT added this to the 9.0.1xx milestone May 7, 2024
@marcpopMSFT marcpopMSFT added good first issue Issues that would be a good fit for someone new to the repository. Narrow in scope, well-defined. new-hire-issue labels May 7, 2024
@joecus1
Copy link

joecus1 commented May 8, 2024

I can work on this!

@WenningQiu
Copy link
Author

@joecus1 Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Tools good first issue Issues that would be a good fit for someone new to the repository. Narrow in scope, well-defined. new-hire-issue
Projects
None yet
Development

No branches or pull requests

4 participants