无法在使用 visual studio for mac 的 .net core 2.1 项目中使用 add-Migration
cannot use add-Migration in .net core 2.1 project using visual studio for mac
我正在为 Mac 使用 Visual Studio 并且有 .NET Core 2.1 项目。我在使用“Add-Migration”等任何迁移命令时遇到问题,即出现以下错误:
**Add-Migration : The term ‘Add-Migration’ is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Add-Migration DBUpdates -Context applicationdbcontext
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Add-Migration:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException**
知道这可能是什么原因吗?
此错误表示缺少一个包裹。
从 nuget 安装包 Microsoft.EntityFrameworkCore.Tools
。然后重新打开 visual studio.
您可能缺少 nuget 包,如果不是这种情况,请仔细检查 Visual Studio 中的 powershell 接口是否指向正确的项目(您想要 DbContext 对象存在并定义的那个)
我正在为 Mac 使用 Visual Studio 并且有 .NET Core 2.1 项目。我在使用“Add-Migration”等任何迁移命令时遇到问题,即出现以下错误:
**Add-Migration : The term ‘Add-Migration’ is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Add-Migration DBUpdates -Context applicationdbcontext
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Add-Migration:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException**
知道这可能是什么原因吗?
此错误表示缺少一个包裹。
从 nuget 安装包 Microsoft.EntityFrameworkCore.Tools
。然后重新打开 visual studio.
您可能缺少 nuget 包,如果不是这种情况,请仔细检查 Visual Studio 中的 powershell 接口是否指向正确的项目(您想要 DbContext 对象存在并定义的那个)