Home > Mobile >  .Net 6 Migrate a context that is located in a different layer
.Net 6 Migrate a context that is located in a different layer

Time:05-16

I have been trying to migrate a context that is called IntegrationEventLogContext and is located in a different layer, but it is getting an error which says;

"dotnet : Could not execute because the specified command or file was not found"

I am using this command to migrate the context.

dotnet ef migrations add Initial -c IntegrationEventLogContext -p IntegrationEventLogEF -o Ordering.API/Infrastructure/IntegrationEventMigrations

In addition, I would like the migration files to be created in the location that I specified.

enter image description here

How can I migrate the context?

CodePudding user response:

I try to check for similar issues and it looks like the dotnet ef tool is no longer part of the .NET Core SDK

You could try to perform the steps below.

  1. Run the command prompt as an Administrator.
  2. Execute the command below to install dotnet ef tool.

dotnet tool install --global dotnet-ef

Run the command below to install any specific version.

dotnet tool install --global dotnet-ef --version {{dotnetef_version}}

Reference:

Command dotnet ef not found

  • Related