我最近安装了.NET Core 1.0 RC2,我知道命令DNX已更改为dotnet.exe命令,但知道我找不到如何创建新的EF7迁移文件。无论我尝试什么"dotnet ef"命令我得到
dotnet : No executable found matching command "dotnet-ef"
At line:1 char:1
+ dotnet ef
+ ~~~~~~~~~
+ CategoryInfo : NotSpecified: (No executable f...and "dotnet-ef":String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
还有类似的东西,如果尝试从VS PS控制台女巫中的"添加迁移"命令给我这个:
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
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Add-Migration:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
我从 3 小时开始谷歌搜索没有任何结果。
我觉得一个包裹不见了。
这里是否有人已成功创建新的 EF7 迁移类。 安装 RC2 后?
这些命令位于工具包中,因此请在程序包管理器控制台中运行以下命令(或通过 NuGet 程序包管理器 UI 添加程序包):
Install-Package Microsoft.EntityFrameworkCore.Tools –Pre
几天前,我将一个带有EF Core 1 RC2的小应用程序推送到GitHub,其中Add-Migration在其中工作。如有必要,您可以将其用作参考。
我已经建立了解决方案...
您需要将Microsoft.EntityFrameworkCore.Tools软件包添加到您的项目中
我发现了同样的问题。
在Visual Studio选项Powershell交互式控制台中。
然后转到项目所在的目录。我需要在包含项目文件的同一目录中。然后运行显示 dotnet ef 命令行帮助数据的 dotnet ef。