Efcore: Remove dotnet-ef from the .NET Core 3.0 SDK

Created on 27 Nov 2018  路  10Comments  路  Source: dotnet/efcore

The EF Core runtime isn't a part of the SDK anymore. It makes sense for dotnet ef to become just a plain old global tool too on NuGet.

breaking-change closed-fixed type-enhancement

Most helpful comment

Note, during pre-release, you'll need to specify the version:

dotnet tool install --global dotnet-ef --version 3.0.0-*

All 10 comments

@KathleenDollard can you keep us in the loop regarding any future plans for global tools that extend dotnet?

Blocked on syncing with the CLI team about the future of tools.
Talking points:

  • Can templates install local tools? Do they have to be invoked using dotnet tool run ef or would dotnet ef still work?
  • Will a global tool continue to be able to extend the dotnet command? If not, should we rename our command now to avoid future breaks?

cc @wli3

  • @KathleenDollard

Can templates install local tools? Do they have to be invoked using dotnet tool run ef or would dotnet ef still work?

Yes. You can add a tool manifest file in the template. We plan to bring back invoke by dotnet TOOLNAME https://github.com/dotnet/cli/pulls . As of today, the user need to run dotnet tool run TOOLNAME. And the user need an extra dotnet tool restore. But this is might change.

Will a global tool continue to be able to extend the dotnet command? If not, should we rename our command now to avoid future

We don't have plan to remove the extension. @KathleenDollard may have more thinking

Thanks, @wli3!

Hey cool, because of the code already in the CLI for source build, it looks like users will get this error when they try to run:

Cannot find command 'dotnet ef', please run the following command to install

dotnet tool install --global dotnet-ef

@bricelam any chance we can create an entry in the breaking change page for this today in preparation for the preview 4 announcement?

Even after manually installation of dotnet-ef tool it is not available.
Got error The application to execute does not exist: 'C:\Users\Slava.Trenogin\.dotnet\tools\.store\dotnet-ef\2.2.4-servicing-10062 \dotnet-ef\2.2.4-servicing-10062\tools\netcoreapp2.2\any\dotnet-ef.dll'.
Real folder is "C:\Users\Slava.Trenogin\.dotnet\tools\.store\dotnet-ef\2.2.4\dotnet-ef\2.2.4\tools\netcoreapp2.2\any\dotnet-ef.dll"
As you can see, no -servicing-10062 suffix.

Installation was executed successfully with message:

dotnet tool install --global dotnet-ef
You can invoke the tool using the following command: dotnet-ef
Tool 'dotnet-ef' (version '2.2.4') was successfully installed.

Note, during pre-release, you'll need to specify the version:

dotnet tool install --global dotnet-ef --version 3.0.0-*

After lot of research and findings , i delete the already installed dotnet-ef (C:\Users\khurram.dotnet...) and install by using dotnet tool install --global dotnet-ef --version 3.0.0-* and it worked for me.

How do I use dotnet-ef in automated Devops -> Azure App deployments now? My build step is throwing this error:

Could not execute because the specified command or file was not found.

I tried to install dotnet-ef via Kudu Debug Console and got the following sequence:

D:\home>dotnet tool install --global dotnet-ef
Tools directory 'D:\local\UserProfile\.dotnet\tools' is not currently on the PATH environment variable.

You can add the directory to the PATH by running the following command:

setx PATH "%PATH%;D:\local\UserProfile\.dotnet\tools"

You can invoke the tool using the following command: dotnet-ef
Tool 'dotnet-ef' (version '3.1.8') was successfully installed.

D:\home>setx PATH "%PATH%;D:\local\UserProfile\.dotnet\tools"

WARNING: The data being saved is truncated to 1024 characters.

ERROR: Access to the registry path is denied.

And, as predicted, if I try to use it:

D:\home>dotnet ef
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-ef does not exist.
  * You intended to r
un a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

All the tutorials on the internet that I could find about how to do this are now out of date because they assume that dotnet-ef ships with dotnet, and I can't locate any official Microsoft documentation about how to deploy EF Core Migrations as part of an automated Devops deployment.

Was this page helpful?
0 / 5 - 0 ratings