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 install doesn't respect isRoot property in manifest #40655

Open
havranek1024 opened this issue May 3, 2024 · 1 comment
Open
Assignees
Milestone

Comments

@havranek1024
Copy link

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 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
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Tools untriaged Request triage from a team member labels May 3, 2024
@grzegorz-wolszczak
Copy link

Hi, I'm also impacted by this issue :(

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