RIDER EF plugin problem

Whenever trying to migrate my DbContext I get the following error in Rider console.

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 program, but dotnet-ef 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.
EF tools installed correctly, globally, working in iTerm.

0
17 comments

Could you refer the FAQ in EF Core Plugin? Ensure your project is matching the prerequisites mentioned there.

The .dotnet/tools should be added in your PATH, and you should be able to finish the database migrations with dotnet ef commands as well.

0

This is the part of console command EF plugin is tryin to execute:

“………..--project Dir/file_name.csproj --startup-project Dir/file_name.csproj……… ”.

When I use my iTerm terminal window I use --project Dir --startup-project Dir (this works for me). Seems like adding /*.cspoj filename at the end of --startup-project and --project paths fails this plugin. 

 

0

What's the exact error information? Adding path with .csproj is standard usage.

There is a known issue of dotnet ef, which the .dcproj file in the same directory may causing the issue. Our plugin is impacted as well (you will notice the rider-eforce project referred in the issue).

0

this is exact error message: 

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 program, but dotnet-ef 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.

No .dcproj files included in same dir, not present at all in whole solution.

0

What's the result of running echo $PATH in your Rider integrated terminal?

It also worth to check if the problem is reproducible in a simple console app solution, see if it's a solution specific issue as mentioned in the issue I shared with you.

0

It also worth to check if the problem is reproducible in a simple console app ….- I definitely will

0

Also, you can check in Settings | Plugins to ensure you have latest EF Core UI plugin installed.

0

simple console API, database up and running (docker), updated, than I try to apply some test migration:

/usr/local/share/dotnet/dotnet ef migrations add --project RestaurantAPI.csproj --startup-project RestaurantAPI.csproj --context RestaurantAPI.entities.RestaurantDbContext --configuration Debug --verbose test --output-dir Migrations
Possible reasons for this include:
 * You misspelled a built-in dotnet command.
 * You intended to execute a .NET program, but dotnet-ef 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.
Could not execute because the specified command or file was not found.

Process finished with exit code 1.
 

Plugin up to date.

0

I'm still wondering if you have installed the EF CLI globally. 

If you have the EF tools installed globally, with the dotnet ef(please note the entry is dotnet but not dotnet-ef) you should still be able to start the tool correctly. Can you try to run the dotnet ef in Rider terminal? 

0

yes, please

and the console

0

Reinstall Rider, reinstall plugin?

0

No, the log is clear that the IDE installation isn't the cause of the problem. Could you try to uninstall the dotnet-ef, reinstall the tool globally with sudo?

If you still encounter issue in EF Core UI tools, cd to /usr/local/share/dotnet/, then execute which dotnet and which dotnet-ef see if it's working.

0

Reinstalled ef with sudo, to no effect. 

 Here is the which command:

0

Interesting, please try to add $HOME/.dotnet/tools to PATH, and ensure you have the corresponding dotnet SDK 8.0.2 installed.

If the issue still occurring, please create a new support request in Help | Contact Support and share the case ID.

0

this is my .zshrc

and .net

➜  ~ source ~/.zshrc
➜  ~ dotnet --version
8.0.200
➜  ~

0

I have this problem too. I also use zsh. And I have added the following line in the following files:

~/.bashrc
export PATH=$PATH:$HOME/.dotnet/tools

~/.zshrc
export PATH=$PATH:$HOME/.dotnet/tools


I have run dotnet ef command in bash, zsh and sh shells and there is no problem!!

0

Refer to the issue and comments here: https://github.com/JetBrains/rider-efcore/issues/215#issuecomment-1968826766

Could you please check if zsh is your default shell in Rider? In Settings | Terminal, check your shell path.

Try to dump your PATH with IDE scripting tools, and use the open command to start Rider from the terminal.

0

Please sign in to leave a comment.