You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 it sub
In the sub folder run dotnet new tool-manifest
Still in the sub folder run dotnet 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 main folder instead of sub
Still in sub folder run dotnet tool run dotnetsay
SDK will show error Cannot find a tool in the manifest file that has a command named 'dotnetsay'.
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
The text was updated successfully, but these errors were encountered:
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 ifdotnet-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
main
dotnet new tool-manifest
dotnet tool install dotnetsay
main
- let's call itsub
sub
folder rundotnet new tool-manifest
sub
folder rundotnet tool install dotnetsay
Tool 'dotnetsay' is up to date (version '2.1.7' manifest file C:\Source\main\.config\dotnet-tools.json)
main
folder instead ofsub
sub
folder rundotnet tool run dotnetsay
Cannot find a tool in the manifest file that has a command named 'dotnetsay'.
Exceptions (if any)
Further technical details
The text was updated successfully, but these errors were encountered: