Sdk: Can't upgrade EF command line tool

Created on 30 Dec 2019  路  7Comments  路  Source: dotnet/sdk

I've recently upgraded to EF Core 3.1.0. I'd also like to upgrade my command line tools, but...

> dotnet tool update --global dotnet-ef
Tool 'dotnet-ef' has multiple versions installed and cannot be updated.

Ooh dear, how did that happen?

> dotnet tool list -g
Warning: tool package 'dotnet-ef' is invalid, contact tool author:
Failed to retrieve tool configuration: Could not find a part of the path 'C:\Users\Me\.dotnet\tools\.store\dotnet-ef\2.1.11-servicing-32099\dotnet-ef\2.1.11\tools\netcoreapp2.1\any\DotnetToolSettings.xml'.
Package Id      Version      Commands
--------------------------------------
dotnet-ef       2.1.11       dotnet-ef

So...how do I upgrade my command line tools?

Most helpful comment

@shaulbehr Sorry, you also need to remove the file C:\Users\Me\.dotnet\tools\dotnet-ef.exe

All 7 comments

@wli3 can you take a look?

@shaulbehr a quick workaround is to (make back first and) delete C:\Users\Me\.dotnet\tools\.store\dotnet-ef folder. You should be able to install it again.

However, for our own bug investigation, could you see if the file is actually missing? "C:Users\Me.dotnet\tools.store\dotnet-ef\2.1.11-servicing-32099\dotnet-ef\2.1.11\tools\netcoreapp2.1\any\DotnetToolSettings.xml"

@wli3 yes, the file is actually missing. In the directory C:\Users\Me\.dotnet\tools\.store\dotnet-ef\2.1.11-servicing-32099\dotnet-ef, there is no 2.1.11 folder, just 2.1.11-servicing-32099

@wli3 I tried your workaround, deleting that dotnet-ef directory. Now I get:

> dotnet tool install --global dotnet-ef --version 3.1.0
Failed to create shell shim for tool 'dotnet-ef': Command 'dotnet-ef' conflicts with an existing command from another tool.
Tool 'dotnet-ef' failed to install.

@shaulbehr Sorry, you also need to remove the file C:\Users\Me\.dotnet\tools\dotnet-ef.exe

@shaulbehr did it work?

@wli3 seems so, thanks!
bitmoji

Was this page helpful?
0 / 5 - 0 ratings