-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
Describe the bug
When installing local dotnet tool using dotnet tool install, it will traverse folder structure to see if that tool is already installed in any of parent folders. It will do that even if dotnet-tools.json in current folder has "isRoot": true. However when trying to run the tool, it will not go to a parent folder to look for it and will say that tool is not installed. This behavior is inconsistent and makes using the tool impossible in a subfolder that has it's own manifest file.
To Reproduce
- Create a folder, for example named
main - In this folder run
dotnet new tool-manifest - Still in the same folder run
dotnet tool install dotnetsay - Create a subfolder in
main- let's call itsub - In the
subfolder rundotnet new tool-manifest - Still in the
subfolder rundotnet tool install dotnetsay- At that point the tool will not be installed in local folder, the SDK will say
Tool 'dotnetsay' is up to date (version '2.1.7' manifest file C:\Source\main\.config\dotnet-tools.json) - Note that it mentions manifest from a
mainfolder instead ofsub
- At that point the tool will not be installed in local folder, the SDK will say
- Still in
subfolder rundotnet tool run dotnetsay- SDK will show error
Cannot find a tool in the manifest file that has a command named 'dotnetsay'.
- SDK will show error
Exceptions (if any)
Further technical details
- The issue is in ToolInstallLocalCommand class
- The issue has been introduced in 8.0.2 - earlier versions would not look in parent folders to see if the tool is already installed, they would just use first found manifest
Reactions are currently unavailable