6

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:

The term 'Scaffold-DbContext' is not recognized as the name of a cmdlet.

I don't know what is the problem, I have tried to install the entityFrameworks.Commands but the problem is not solved.

2 Answers 2

3

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.

0

Don't forget to run visual studio as Administrator or you get that error

Not the answer you're looking for? Browse other questions tagged or ask your own question.