dotnet 工具安装 --global dotnet-ef

Nat*_*den 7 .net visual-studio-code

错误 NU1100:无法解析“net5.0”的“dotnet-ef (>= 0.0.0)”。错误 NU1100:无法解析“net5.0/any”的“dotnet-ef (>= 0.0.0)”。工具包无法恢复。工具“dotnet-ef”安装失败。此故障可能是由以下原因引起的:

  • 您正在尝试安装预览版本,但未使用 --version 选项指定版本。
  • 找到了同名的包,但它不是 .NET 工具。
  • 无法访问所需的 NuGet 源,可能是由于 Internet 连接问题。
  • 您输错了该工具的名称。

有关更多原因(包括包命名强制),请访问https://aka.ms/failure-installing-tool 错误 NU1100:无法解析“net5.0”的“dotnet-aspnet-codegenerator (>= 0.0.0)”。错误 NU1100:无法解析“net5.0/any”的“dotnet-aspnet-codegenerator (>= 0.0.0)”。工具包无法恢复。工具“dotnet-aspnet-codegenerator”安装失败。此故障可能是由以下原因引起的:

  • 您正在尝试安装预览版本,但未使用 --version 选项指定版本。
  • 找到了同名的包,但它不是 .NET 工具。
  • 无法访问所需的 NuGet 源,可能是由于 Internet 连接问题。
  • 您输错了该工具的名称。

Rod*_*ner 16

dotnet nuget list source返回一个空列表。我猜你只会在安装 dotnet 时遇到这个问题,而没有在你的机器上安装 Visual Studio,并预先填充官方 nuget 站点作为源。

跑步dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org为我解决了这个问题。

请参阅https://github.com/dotnet/EntityFramework.Docs/issues/2044#issuecomment-910202971


小智 0

将其安装在本地项目而不是全局项目中,它对我有用。一一执行以下命令:

  1. dotnet 新工具清单(这将是项目中的 dotnet-tools.json 文件)
  2. dotnet 工具安装 --local dotnet-ef --version 5.0.5
  3. 点网EF