Description
Is your feature request related to a problem? Please describe.
I want to install tools for one project specifically and want it installed to the project directory, as well as it being reinstalled to this path when someone else runs dotnet tool restore
.
I can already install the tool to my project using --tool-path
with local tool install, However, the path itself is not stored in the project's dotnet-tools.json
. Thus, when I restore the tools on another machine using dotnet tool restore
, it does not restore at the specified relative path.
I expected this feature to be here since Nuget.config
already supports this for a long time. It is odd to me that dotnet-tools.json
doesn't support this use-case.
Describe the solution you'd like
Like with Nuget.config
, I would like the config to store the relative install path. If this would break behaviour, I suggest adding the --project-tool
switch to enable this functionality.
As example:
dotnet tool install --project-tool --tool-path=./nuget/tools/ dotnet-coverage
Inside the config, it would look like this:
Why this solution?
Sometimes I have to use multiple projects with different tool versions that are incompatible. Having a large userbase manually install the right tool version at the right path is a problem. Having to write setup scripts for this is problematic because it's non-standard.
This solution would minimize the risk of failure on installation, and seems like a small enough change to not require extensive modification in the tool manifest or dotnet tool command.