gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 14:44:39 25 4
gpt4 key购买 nike

我正在尝试通过 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

最佳答案

我通过添加 --version 标志并将版本指定为 3.0.0 使其正常工作。

我使用的命令:

dotnet 工具安装 --global dotnet-ef --version 3.0.0

关于c# - 无法在 Windows 10 上安装 dotnet-ef 工具,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58764322/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com