Scaffold-DbContext is not recognized as a cmdlet name

I have a solution with two projects, one of which is the main project, and the second is a project that will use EF Core 10.0 RC2.

In the second project, I use these three commands to install EF Core and run these nuget commands to install it:

Install-Package Microsoft.EntityFrameworkCore.SqlServerPre
Install-Package Microsoft.EntityFrameworkCore.ToolsPre
Install-Package Microsoft.EntityFrameworkCore.SqlServer.DesignPre

Later I can create my model from the database using 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 tried to run the same command to generate models again, I get this error:

The term "Scaffold-DbContext" is not recognized as the cmdlet name.

I do not know what the problem is, I tried to set entityFrameworks.Commands, but the problem is not solved.

+3
1

:

dotnet restore --infer-runtimes

https://github.com/aspnet/EntityFramework/issues/5549, -.

+1

Source: https://habr.com/ru/post/1654374/


All Articles