efcore icon indicating copy to clipboard operation
efcore copied to clipboard

Remove dotnet-ef from the .NET Core 3.0 SDK

Open bricelam opened this issue 8 years ago • 10 comments

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.

bricelam avatar Nov 26 '18 23:11 bricelam

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

bricelam avatar Nov 30 '18 18:11 bricelam

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

bricelam avatar Mar 15 '19 20:03 bricelam

  • @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

wli3 avatar Mar 15 '19 20:03 wli3

Thanks, @wli3!

bricelam avatar Mar 16 '19 01:03 bricelam

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 avatar Mar 25 '19 19:03 bricelam

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

divega avatar Apr 15 '19 18:04 divega

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.

derigel23 avatar Apr 27 '19 18:04 derigel23

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

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

bricelam avatar Apr 30 '19 16:04 bricelam

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.

khuramshahzad avatar May 21 '19 11:05 khuramshahzad

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.

korggy avatar Sep 12 '20 20:09 korggy