-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 format (latest 8) intermittently fails with "Unable to locate dotnet CLI. Ensure that it is on the PATH." #44957
Comments
We are also seeing this occur randomly in GitHub actions. |
Also seeing this on GitHub actions |
We've also started to see this on a second repository. It's consistently failing on the Windows GitHub worker but seems fine on Linux. |
It seems adding env vars, especially DOTNET_ROOT helped: https://github.com/icsharpcode/ILSpy/blob/e28d04810ac5ea3235c6b3b8ea5795bf42bbf0a5/.github/workflows/build-ilspy.yml#L29-L35 |
Thanks @christophwille ! In my case, So it would be like - name: Set up .NET Core
uses: actions/[email protected]
with:
global-json-file: path/to/global.json
env:
DOTNET_INSTALL_DIR: ${{ runner.temp }}/.dotnet And it is interesting to see in the downstream step log, dotnet format my.sln --verify-no-changes
shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
env:
NUGET: C:\hostedtoolcache\windows\nuget.exe\6.12.1\x6[4](https://github.com/hongbo-miao/hongbomiao.com/actions/runs/12333172993/job/34421902814?pr=21563#step:6:4)/nuget.exe
DOTNET_ROOT: D:\a\_temp\.dotnet |
Initially opened over at dotnet/format#2218 (forgot that it was moved...)
This started happening to our Github builds this weekend:
We never had any issues whatsoever, so initially we were looking at the newly installed net90, but then found microsoft/azure-pipelines-tasks#19162 (and by extension dotnet/format#2000). However, when locking to the latest version in https://github.com/icsharpcode/ILSpy/pull/3338/files we still see "Unable to locate dotnet CLI. Ensure that it is on the PATH.".
So it wasn't the old-ish version of dotnet-format that tripped us up but it happens also with the latest 8-series one. Any ideas/pointers where to start looking next? This flakiness is annoying (but not a showstopper atm).
The text was updated successfully, but these errors were encountered: