enter image description here
我正在尝试使用 Entity Framework 工作核心并打开一个新的 asp.net 核心项目。当我尝试通过 nuget 包管理器安装 Microsoft.EntityFrameworkCore.SqlServer 时,出现以下错误。
包 Microsoft.EntityFrameworkCore.SqlServer 3.0.0 与 net461 (.NETFramework,Version=v4.6.1) 不兼容。包 Microsoft.EntityFrameworkCore.SqlServer 3.0.0 支持:netstandard2.1 (.NETStandard,Version=v2.1)
当我点击它时,我被发送到 .csproj 文件。
在该文件中,我将目标框架从<TargetFramework>net461</TargetFramework>
到<TargetFramework>netstandard2.1 </TargetFramework>
正如错误所暗示的那样。
这样做可以消除错误,但是当我在包管理器控制台中使用命令“add-migration”时,出现此错误。
“术语 'add-migration' 不被识别为 cmdlet 的名称”
我不确定接下来要做什么。请帮忙。我希望我已经清楚地解释了这个问题。
删除 project.assets 文件或更新 nuget 包管理器并使用命令“enable-migrations”也没有奏效。
enter image description here
最佳答案
以下帮助我将缺少的工具添加到 .net core 3.1
从这里 Blog
关于c# - "the term ' 添加迁移 ' is not recognized as the name of a cmdlet" Visual Studio 2019,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58233950/