我正在尝试通过dotnet-cli安装dotnet-ef工具。
我输入的命令是:dotnet tool install --global dotnet-ef
它给了我以下错误提示:
我输入的命令是:dotnet tool install --global dotnet-ef
它给了我以下错误提示:
C:\Users\%USERNAME%\AppData\Local\Temp\147383a8-b714-4336-bb96-30c0670ea37d\restore.csproj : error NU1211: Project res
tore must have a single package reference(s).
C:\Users\abby.rahimi\AppData\Local\Temp\147383a8-b714-4336-bb96-30c0670ea37d\restore.csproj : error NU1212: Invalid pro
ject-package combination for Microsoft.DotNet.Analyzers.Compatibility 0.2.12-alpha. DotnetToolReference project style c
an 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.
不仅仅是EF,我无法安装任何其他工具。
我尝试指定版本,但仍然无法正常工作。 我尝试了很多方法:
- dotnet tool install -g dotnet-ef --ignore-failed-sources
- 重新安装dotnet sdks(3.1和6.0.305)
- dotnet tool uninstall --global dotnet-ef,然后再次尝试安装
- 从C:\ Users%USERNAME%.dotnet \ tools中删除可执行文件dotnet-ef.exe
- 在PowerShell和Win CLI中运行命令
我可以访问https://api.nuget.org/v3/index.json,所以这不是我的互联网连接的问题。