Reputation: 83
I'm trying to install the dotnet-ef tool via the dotnet-cli.
The command that I enter: dotnet tool install --global dotnet-ef --version 6.0.4
It gives me the following error:
C:\Users\orbit>dotnet tool install --global dotnet-ef --version 6.0.4
C:\Users\orbit\AppData\Local\Temp\yfvm4duz.fcf\restore.csproj : error NU1211: Project restore must have a single package reference(s).
C:\Users\orbit\AppData\Local\Temp\yfvm4duz.fcf\restore.csproj : error NU1212: Invalid project-package combination for Packaging.Targets 0.1.171. DotnetToolReference project style can only contain references of the DotnetTool type
The tool package could not be restored.
Tool 'dotnet-ef' failed to install. This failure may have been caused by:
* You are attempting to install a preview release and did not use the --version option to specify the version.
* A package by this name was found, but it was not a .NET tool.
* The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
* You mistyped the name of the tool.
For more reasons, including package naming enforcement, visit https://aka.ms/failure-installing-tool
Some info using dotnet --info
command:
C:\Users\orbit> dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.202
Commit: f8a55617d2
Runtime Environment:
OS Name: Windows
OS Version: 10.0.22000
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.202\
Host (useful for support):
Version: 6.0.4
Commit: be98e88c76
.NET SDKs installed:
5.0.303 [C:\Program Files\dotnet\sdk]
5.0.407 [C:\Program Files\dotnet\sdk]
6.0.101 [C:\Program Files\dotnet\sdk]
6.0.104 [C:\Program Files\dotnet\sdk]
6.0.202 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
I have an acces to https://api.nuget.org/v3/index.json so it's not the problem with my internet connection.
I tried to delete C:\Program Files\dotnet\sdk-manifests
without any result.
Also I tried dotnet tool install -g dotnet-ef --version 6.0.4 --ignore-failed-sources
command. The same exception message.
I found that this problem could be not only with the dontet-ef tool, but with every tool, because I tried to install dotnetsay
tool and got the same exact error messages.
Upvotes: 2
Views: 3215
Reputation: 76
I solved the same issue by removing
dotnet-ef.exe
from C:\Users\%USERNAME%\.dotnet\tools
dotnet-ef
from C:\Users\%USERNAME%\.dotnet\tools\.store\
manually.
After that, I used dotnet tool install --global dotnet-ef --version 6.0.6
Upvotes: 1
Reputation: 86
Try to uninstall it with this command:
dotnet tool uninstall --global dotnet-ef
then install (without --version) like this:
dotnet tool install --global dotnet-ef
and check the version, if you want to update to newer versions, try this command:
dotnet tool update --global dotnet-ef
Upvotes: 3