Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Microsoft.EntityFrameworkCore.Tools 3.1.4。添加迁移不起作用_C#_.net_Entity Framework Core - Fatal编程技术网

C# Microsoft.EntityFrameworkCore.Tools 3.1.4。添加迁移不起作用

C# Microsoft.EntityFrameworkCore.Tools 3.1.4。添加迁移不起作用,c#,.net,entity-framework-core,C#,.net,Entity Framework Core,我想在我的EF核心库项目中使用迁移 我安装了NuGet软件包 Microsoft.EntityFrameworkCore 3.1.4 Microsoft.EntityFrameworkCore.SqlServer 3.1.4 Microsoft.EntityFrameworkCore.Tools 3.1.4 但是,addmigration命令从未出现在PM控制台中 当我重新启动Visual Studio 2019时。PM控制台中出现错误: Package Manager Console Ho

我想在我的EF核心库项目中使用迁移

我安装了NuGet软件包

  • Microsoft.EntityFrameworkCore 3.1.4
  • Microsoft.EntityFrameworkCore.SqlServer 3.1.4
  • Microsoft.EntityFrameworkCore.Tools 3.1.4
但是,
addmigration
命令从未出现在PM控制台中

当我重新启动Visual Studio 2019时。PM控制台中出现错误:

Package Manager Console Host Version 5.5.0.6473

Type 'get-help NuGet' to see all available NuGet commands.

& : The term 'C:\Users\ruslan.runchev\.nuget\packages\microsoft.entityframeworkcore.tools\3.1.4\tools\init.ps1' is not recognized as the n
ame of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the pa
th is correct and try again.
At line:1 char:45
+ ... rgs+=$_}; & 'C:\Users\ruslan.runchev\.nuget\packages\microsoft.entity ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\ruslan...\tools\init.ps1:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PM> 

如何解决此问题?

是否使用visual studio?无论哪种方式,请尝试添加迁移的名称。您是否执行了
dotnet ef migrations add
?也请尝试删除我使用的
工具
包VS 2019 16.5.4。“dotnet ef migrations add”是软件包管理器控制台的命令吗?我删除了Microsoft.EntityFrameworkCore.Tools软件包,甚至安装了早期版本。没有帮助您使用visual studio吗?无论哪种方式,请尝试添加迁移的名称。您是否执行了
dotnet ef migrations add
?也请尝试删除我使用的
工具
包VS 2019 16.5.4。“dotnet ef migrations add”是软件包管理器控制台的命令吗?我删除了Microsoft.EntityFrameworkCore.Tools软件包,甚至安装了早期版本。无济于事