Cannot find command `dotnet ef` out of sudden.
See original GitHub issueIssue similar to dotnet/efcore#15448 and dotnet/efcore#19861.
We’ve got a CI agent which runs the dotnet ef
command in one of the steps. Out of sudden it stopped working and I receieved the same
Could not execute because the specified command or file was not found.
Possible reasons for this include:
* You misspelled a built-in dotnet command.
* You intended to execute a .NET Core program, but dotnet-xyz does not exist.
* You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH
error like the others. It’s hard to tell what caused that, taking into account that it’s just a ci agent and the same routine happens there every day. I may suspect only windows update…
Nevertheless, the tool was obviously where it was before %USERPROFILE%\.dotnet\tools
. I tried to reinstall it, upgrade it (from 3.0.0 to the latest 3.1.6) and restarting the pc, but nothing happened.
The path variable was correctly set, but it was a user-defined variable, not the machine one, which I believe is correct. After some struggling I simply added this user-scoped path to the machine-wide path and it started to work. Maybe this can help to investigate the issue.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:14 (3 by maintainers)
Top GitHub Comments
What solved it for me on Mac: Add to PATH:
~/.dotnet/tools
I found the issue! check your global.json file and change the version. It finally works!