How to scaffold EF core to existing DB?

asp.net-core ef-code-first entity-framework-core

Question

I am trying to reverse engineer an existing database using Entity Framework Core. I tried to follow the directions from Microsoft but I am presented with the error:

Unable to find provider assembly with name EntityFramework. Ensure the specified name is correct and is referenced by the project.

I am running the following command from the project directory:

dnx ef dbcontext scaffold "Server=REMOVED;Database=REMOVED;User ID=REMOVED;Password=REMOVED" EntityFramework

What am I doing wrong?

1
6
2/9/2016 8:53:27 PM

Accepted Answer

Make sure you are in the project folder and not the solution folder context. I was able to get this to work with the following yesterday (Notice the EntityFramework.MicrosoftSqlServer at the end)

dnx ef dbcontext scaffold "{connectionString}" EntityFramework.MicrosoftSqlServer

EDIT:

Make sure to include the following in your project.json:

EntityFramework.MicrosoftSqlServer.Design
2
2/9/2016 9:24:38 PM

Popular Answer

Install fallowing NuGet package:

Install-Package Microsoft.EntityFrameworkCore.SqlServer


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow