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 "tool" issue when using custom nuget.config + globalPackagesFolder #16165

Open
JHorvath-MaxetaTech opened this issue Mar 2, 2021 · 3 comments
Milestone

Comments

@JHorvath-MaxetaTech
Copy link

When using a custom nuget.config that defines globalPackagesFolder along side a .NET 5.0 solution (to provide a local path to restore package to)

<?xml version="1.0" encoding="utf-8"?>
 <configuration>
  <config>
    <add key="globalPackagesFolder" value="..\lib\nuget" />
  </config>
  <solution>
    <add key="disableSourceControlIntegration" value="true" />
  </solution>
</configuration>

Performing a dotnet tool install %tool_name% --version %version_number% will inject that tool's NuGet package appropriately into the specified globalPackagesFolder path, as well as generate an appropriate file under the global toolResolverCache folder:

%userprofile%\.dotnet\toolResolverCache\1\%tool_name%

However... the PathToExecutable reference inside the file will then never change (per tool version installed). Performing a second dotnet tool install for the same tool/version in a separate similarly setup solution, will leave the PathToExecutable value unchanged (despite the fact the file does appear to be touched). If the original solution is ever removed the tool then breaks across the board and can not be fixed without manually modifying/deleting the file.

Neither dotnet tool restore nor dotnet tool update appear to update the PathToExecutable either, forcing all tools to be installed globally first before ever using a custom nuget.config.

I understand the point of the toolResolverCache is based around consolidating tool installations globally, but if a custom nuget.config is supplied with a solution, it seems like the tool NuGet packages should be referenced in the same manner as any other NuGet Package by the globalPackagesFolder reference first, using the toolResolverCache as a global fallback.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Request triage from a team member label Mar 2, 2021
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@marcpopMSFT marcpopMSFT self-assigned this Mar 4, 2021
@marcpopMSFT marcpopMSFT added Area-Tools needs team triage Requires a full team discussion and removed untriaged Request triage from a team member labels Mar 4, 2021
@marcpopMSFT marcpopMSFT added this to the Backlog milestone Mar 10, 2021
@marcpopMSFT marcpopMSFT removed the needs team triage Requires a full team discussion label Mar 10, 2021
@marcpopMSFT marcpopMSFT removed their assignment Mar 10, 2021
@0x53A
Copy link
Contributor

0x53A commented Aug 31, 2021

I have hit this issue multiple times now, and it is really painful

@iamjplant
Copy link

This seems closely related, or maybe even a duplicate of #11432

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

No branches or pull requests

4 participants