我正在尝试使用 EntityFrameworkCore@3.1。为了做到这一点,我已经有了: - 安装了 Visual Studio 2019 预览版 - 安装了 .NET Core 3.1 运行时 - 安装了 .NET Core 3.1 SDK
现在我仍然无法运行命令dotnet ef migrations add xxx。据说我必须更新 dotnet 工具。所以我在管理员 powershell 中运行以下命令:
PS C:\WINDOWS\system32> dotnet tool update --global dotnet-ef
Tool 'dotnet-ef' was reinstalled with the latest stable version (version '3.0.0')
Run Code Online (Sandbox Code Playgroud)
好的,不包括预览版本。所以我尝试明确指定版本:
PS C:\WINDOWS\system32> dotnet tool update --global dotnet-ef --version="3.1.0-preview1.19506.2"
error NU1202: Package dotnet-ef 3.1.0-preview1.19506.2 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1) / any. Package dotnet-ef 3.1.0-preview1.19506.2 supports: netcoreapp3.1 (.NETCoreApp,Version=v3.1)
Tool 'dotnet-ef' failed …Run Code Online (Sandbox Code Playgroud)