huedaya.com/blog
just bunch of .md files
How to Run .NET (dotnet) EF globally

I face error when running dotnet-ef:

plaintext
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.

The solution, add PATH to system environment. So dotnet-ef can be run globally:

bash
export PATH="$PATH:$HOME/.dotnet/tools/"

Try to run dotnet-ef again, then viola! ✨🦄

plaintext

                     _/\__
               ---==/    \\
         ___  ___   |.    \|\
        | __|| __|  |  )   \\\
        | _| | _|   \_/ |  //|\\
        |___||_|       /   \\\/\\

Entity Framework Core .NET Command-line Tools 6.0.0

Usage: dotnet ef [options] [command]

Options:
  --version        Show version information
  -h|--help        Show help information
  -v|--verbose     Show verbose output.
  --no-color       Don't colorize output.
  --prefix-output  Prefix output with level.

Commands:
  database    Commands to manage the database.
  dbcontext   Commands to manage DbContext types.
  migrations  Commands to manage migrations.

Use "dotnet ef [command] --help" for more information about a command.

That's it!

Last update: 2024-02-18 04:53:22 UTC (7 months ago)