I'd like to scaffold a number of tables from an existing database to work with them in a .NET Core 3.0 Web API. Under previous versions of .NET Core, having references to Microsoft.EntityFrameworkCore
, Microsoft.EntityFrameworkCore.SqlServer
, and Microsoft.EntityFrameworkCore.Design
has been sufficient when scaffolding from this database. However, in .NET Core 3.0, when I attempt to scaffold from my database, the following sequence of events happens
- The command prompt hangs
- The references to the necessary NuGet packages (most notably
Microsoft.EntityFrameworkCore.Design
) disappear in the Solution Explorer for my project in Visual Studio - I get the error message
Your startup project '[project name]' doesn't reference Microsoft.EntityFrameworkCore.Design. This package is required for the Entity Framework Core Tools to work. Ensure your startup project is correct, install the package, and try again
To scaffold, I'm running the following command
dotnet ef dbcontext scaffold "[connection string]" microsoft.entityframeworkcore.sqlserver
Connection string omitted since it's very likely not related to the issue.
I've installed Entity Framework as a global tool, as described here, as well as adding package references to the 3 aforementioned NuGet packages, as well as Microsoft.EntityFrameworkCore.Tools
, within my project.
What do I need to do differently in order to get these tables to scaffold correctly?