-
Hi Community, I successfully installed a dotnet tool with the preprocessor directive: But when I want to use it from the build script, I get the error that the tool is not found. I try to use it like this: Apparently, DotNetTool command can execute the sonarscanner tool when it is globally installed. I would prefer to install the tool locally. How can I execute the tool in this case with DotNetTool command? I cannot find any info about this online. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I am afraid you are mixing 2 different "tools". When you use the pre-processor directive I feel you have two solutions to your task: using the
|
Beta Was this translation helpful? Give feedback.
I am afraid you are mixing 2 different "tools".
When you use the pre-processor directive
#tool
, the tool installed in the local cake tools path. This is independent of the "normal"dotnet tool
usage which always installs tools in the global tools path - even if that tool is installed locally.I feel you have two solutions to your task:
using the
#tool
pre-processor directiveThe installed tool can be resolved using
Context.Tools.Resolve
. Thus, code like the following should work: