question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find command `dotnet ef` out of sudden.

See original GitHub issue

Issue 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:open
  • Created 3 years ago
  • Reactions:2
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dmslowmocommented, Jan 20, 2021

What solved it for me on Mac: Add to PATH: ~/.dotnet/tools

1reaction
KujinKrushcommented, Nov 19, 2020

I found the issue! check your global.json file and change the version. It finally works!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot find command 'dotnet ef'
In my case, the tools folder didn't exist inside %USERPROFILE%\.dotnet\ so I had to run the command dotnet tool install --global dotnet-ef ......
Read more >
How to fix: Command dotnet ef not found - Start Debugging
Could not execute because the specified command or file was not found. Possible reasons for this include: – You misspelled a built-in dotnet...
Read more >
Cannot find command 'dotnet ef' and then dotnet-ef.dll isn't in ...
First up, deleting the 2.2.4-servicing-10062 folder I created in %userprofile%\.dotnet\tools\.store\dotnet-ef so that everything is back as ...
Read more >
The Athenaeum - Page 1120 - Google Books Result
There , among the graves of the obscure - save only to the love which has memo- rialized them - lies an obscure...
Read more >
The Household Narrative of Current Events
Colonel Airey is to be succeeded in the command of his brigade by MajorGeneral Codrington ... is supreme in all things or causes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found