使用 netcoreapp3.0 安装 dotnet-ef 时遇到问题

Dee*_*shy 6 c# entity-framework entity-framework-core .net-core netcoreapp3.0

我正在尝试使用 EF 核心迁移功能。但是当我从 NuGet 安装 dotnet-ef 工具时,会抛出以下错误消息。我的应用程序版本是 netcoreapp3.0。

dotnet tool install --global dotnet-ef --version 3.1.0-preview3.19554.8
Run Code Online (Sandbox Code Playgroud)

错误 NU1202:包 dotnet-ef 3.1.0-preview3.19554.8 与 netcoreapp3.0 (.NETCoreApp,Version=v3.0) / any 不兼容。包 dotnet-ef 3.1.0-preview3.19554.8 支持:netcoreapp3.1 (.NETCoreApp,Version=v3.1) / any

旧版本仅支持 netcoreapp2.1

dotnet tool install --global dotnet-ef --version 3.0.1
Run Code Online (Sandbox Code Playgroud)

错误 NU1202:包 dotnet-ef 3.0.1 与 netcoreapp3.0 (.NETCoreApp,Version=v3.0) / any 不兼容。包 dotnet-ef 3.0.1 支持:netcoreapp2.1 (.NETCoreApp,Version=v2.1)

实际上哪个 dotnet-ef 版本支持 netcoreapp3.0 知道吗?

Sam*_*ath 13

这在201911 月对我有用

dotnet tool install --global dotnet-ef --version 3.0.0
Run Code Online (Sandbox Code Playgroud)

  • 谢谢,这救了我!! (2认同)

Mat*_*t U 0

请检查此问题及其答案:更新 .NET Core 工具

正如该问题的答案所指出的,这似乎是一个已知的错误:https://github.com/dotnet/cli/issues/12963

发布该问题的人回答了他们找到的解决方法。也许它也适合你。