问题描述
我有两个项目的解决方案,一个是主要项目,另一个是使用EF Core 10.0 RC2的项目。在第二个项目中,我使用这三个命令安装EF Core并运行这个nuget命令来安装它:
Install-Package Microsoft.EntityFrameworkCore.SqlServer -Pre
安装包Microsoft.EntityFrameworkCore.Tools -Pre
安装包Microsoft.EntityFrameworkCore.SqlServer.Design -Pre
稍后,我可以使用以下命令从数据库创建我的模型:
Scaffold-DbContext 'server =(localdb)\mssqllocaldb; Database = Blogging; Trusted_Connection = True;'Microsoft.EntityFrameworkCore.SqlServer
问题是,如果我退出VS2015并再次打开,如果我尝试运行相同的命令再次生成模型,我得到这个错误:
我不知道是什么问题,我已经尝试安装实体框架命令但是问题没有解决。
你是否尝试过这个命令:
dotnet restore --infer-runtimes
有关详细信息,请访问:,它适用于某人。
I have a solution with two project, one is the main project and the second a project that will use EF Core 10.0 RC2.
In the second project I use this three commands to install EF Core and run this nuget commands to install it:
Install-Package Microsoft.EntityFrameworkCore.SqlServer –Pre
Install-Package Microsoft.EntityFrameworkCore.Tools –Pre
Install-Package Microsoft.EntityFrameworkCore.SqlServer.Design –Pre
Later I can create my model from a database with this command:
Scaffold-DbContext "'Server=(localdb)\mssqllocaldb;Database=Blogging;Trusted_Connection=True;'" Microsoft.EntityFrameworkCore.SqlServer
The problem is that if I exit VS2015 and open again, if I have tried to run the same command to generate again the models, I get this error:
I don't know what is the problem, I have tried to install the entityFrameworks.Commands but the problem is not solved.
Have you tried the command:
dotnet restore --infer-runtimes
For more information, you can visit: https://github.com/aspnet/EntityFramework/issues/5549, it worked for someone.
这篇关于术语“脚手架DbContext”不被识别为cmdlet的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!