Scaffold-DbContext context not found error for .net core 2 / net core 1.1.2
I assumed you have already installed
a) Install-Package Microsoft.EntityFrameworkCore.SqlServer
b) Install-Package Microsoft.EntityFrameworkCore.Tools
c) Install-Package Microsoft.VisualStudio.Web.CodeGeneration.Design
For example, my .net core app is target for 1.1, so
Install-Package Microsoft.EntityFrameworkCore.SqlServer -version 1.1.2
Install-Package Microsoft.EntityFrameworkCore.Tools -version 1.1.1
Might need to restart your VS2017, depending on how convulated your project is. I have a simple project that i just created from scratch i don't eve need to restart. For one for the projects, i did restarted my VS2017.
You will need to get this packages correctly installed depending on what .net project (.netcore 2, .netcore 1.1)
Remember to restart your visual studio, goto Nuget Package Manager console and try running scaffold-dbcontext, for example :-
Scaffold-DbContext "Server=(localdb)\.;Database=IDS_ODS;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir DataModel
Comments