无法在Windows 10上安装dotnet-ef工具

我正在尝试通过dotnet-cli安装dotnet-ef工具。

我输入的命令:dotnet tool install --global dotnet-ef

我给我以下错误:

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 Core tool.
* The required NuGet feed cannot be accessed,perhaps because of an Internet connection problem.
* You mistyped the name of the tool.

我正在使用dotnet 3.0,我相信我在MacOS上没有这个问题,我现在正在尝试在Windows 10计算机上执行相同的命令,这给了我这个错误。

使用dotnet --info命令的一些信息:

.NET Core SDK (reflecting any global.json):
 Version:   3.0.100
 Commit:    04339c3a26

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.18362
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\3.0.100\

Host (useful for support):
  Version: 3.0.0
  Commit:  7d57652f33

.NET Core SDKs installed:
  3.0.100 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\microsoft.AspNetCore.All]
  microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\microsoft.AspNetCore.App]
  microsoft.AspNetCore.App 3.0.0 [C:\Program Files\dotnet\shared\microsoft.AspNetCore.App]
  microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\microsoft.NETCore.App]
  microsoft.NETCore.App 3.0.0 [C:\Program Files\dotnet\shared\microsoft.NETCore.App]
  microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files\dotnet\shared\microsoft.WindowsDesktop.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download 
wwwlll47 回答:无法在Windows 10上安装dotnet-ef工具

我通过添加3.0.0标志并将版本指定到dotnet tool install --global dotnet-ef --version 3.0.0使其工作。

我使用的命令:

System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Data.OleDb.OleDbException: The record cannot be deleted or changed because table 'Items' includes related records.

,

我对其进行了测试,并且效果很好。指定版本号。

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

dotnet tool install -g dotnet-ef --ignore-failed-sources 为我工作。感谢Anas-Alhariri

Source

,

我收到此错误消息,但是当我仔细检查所有错误时,我也遇到了:

Response status code does not indicate success: 407 (Proxy Authorization Required).

在运行命令时关闭代理可解决此问题。

,

当我尝试从包管理器控制台而不是 Powershell 命令窗口运行推荐时出现此错误。

,

我最近在 Mac OS 上遇到了同样的问题。 这与我们使用自己的 NuGet 提要(packageSources 部分)有关。 因此,我暂时从 NuGet.config 文件中删除了自定义 NuGet 提要,从而解决了这个问题。

本文链接:https://www.f2er.com/3138869.html

大家都在问