Closed StefH closed 5 years ago
I have the same problem. I am using a dotnet tool install for dotnet-xdt in one step. That succeeds. Then in a dotnet publish step, dotnet-xdt is executed via the csproj file. But the dotnet-xdt tool cannot be found.
I've tried to switch to a CMD step to do the dotnet tool install as per this issue: https://github.com/dotnet/cli/issues/8368#issuecomment-424852996, but it still does not work for me.
Last time I worked on this project was 8/20/18. And the unchanged pipeline worked then. But today it is no longer working and I haven't changed the csproj or the build pipeline.
Please see this as a workaround.
Created a new issue to handle this problem in Azure pipelines. Closing this issue.
Please see this as a workaround.
@bishal-pdMSFT, I don't know why you closed this. Per my comment above, the work around in (https://github.com/dotnet/cli/issues/8368#issuecomment-424852996) doesn't work for all global tools. I found that if you install a global tool in one pipeline step, then use it in another step, the tool will have been installed in some directory that the build is not happening in. So the tool still cannot be found.
I have created a new issue for this. #8429 Created a new issue as that is applicable only when Dotnet core tool installer task in used. Azure pipelines cannot fix the scenario when an existing installation of dotnet is used - that has to be fixed by dotnet team.
It's confused situation, we can't use global tools, that well works in Appveyor for example.
according to #8429, the fix is rolled out. @vchirikov do you mean this issue still repros?
@wli3 Yes, yesterday I got this error.
I installed dotnet tool install -g Cake.Tool
successfully, but in next step I do something like dotnet cake build/build.cake --target=Coverage
and command failed with No executable found matching command "dotnet-cake"
p.s. I don't like your task for install something, just use script
I wanted to use both ReportGenerator and SonarScanner in my Azure DevOps pipeline and of course, I have encountered the infamous error "No executable found matching command ...".
Th only way I managed to install and use both of these tools was by installing a specific .NET Core SDK version via the DotNetCoreInstaller@0 task before hand:
- task: DotNetCoreInstaller@0
displayName: Install .NET Core SDK
name: install_dotnetcore_sdk
enabled: true
inputs:
packageType: 'sdk'
version: '2.1.500'
I'm not sure whether this approach covers any .NET Core tool, but it did the trick for me.
I think the reason is only DotNetCoreInstaller@0 task will export the global tools path to PATH. And I do think putting extra in PATH by default need more discussion. Meanwhile you could export $HOME/.dotnet/tools
or %USERPROFILE%\.dotnet\tools
to PATH.
If you're using bash, you could refresh its environment with one or more of the following commands:
. ~/.bashrc
. ~/.bashprofile
. ~/.profile
To fix this I did the following after installing a tool using bash
- script: |
dotnet tool update -g #YOUR TOOL
export PATH=$PATH:$HOME/.dotnet/tools
. ~/.bashrc
# RUN TOOL COMMAND HERE
Environment
YML script
Issue Description
I get an error when using
dotnet tool install --global ***
in the new Azure Pipelines flow.My command is like (see above YML file):
This command outputs this:
And the next step will fail (running the above command in the same step or a different script step make no difference)
How to solve this ?