Entity Framework Core 5.0 scaffold-dbcontext hangs within Package Manager

Jim Thomas 41 Reputation points

I have created my first scaffold-dbcontext command and run it in Package Manager Console in Visual Studio 16.6.2. After 'Build succeeded.' the PM just hangs. I can do nothing except restart Visual Studio to get PM back. When I re-open the project the output files appear in the Entities folder of the project, as expected. How do I eliminate the hang?

PM> scaffold-dbcontext -provider Microsoft.EntityFrameworkCore.SqlServer -connection "Data Source=sqldevi\devi;Initial Catalog=anami;Integrated Security=true;Pooling=false;" -OutputDir Entities –Context Anami –Tables member_creditcard
Build started...
Build succeeded.

Here are the packages in the .net core 3.1 project. Note that, as a console app, Program.cs is just the original stub, there is no other code, hence the project compiles successfully!


Microsoft.CodeAnalysis (3.7.0)
Microsoft.Data.SqlCLient (2.0.1)
Microsoft.EntityFrameworkCore (5.0.2)
Microsoft.EntityFrameworkCore.SqlServer (5.0.2)
Microsoft.EntityFrameworkCore.Tools (5.0.2)

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
721 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ErikEJ 341 Reputation points MVP

    How many tables?
    SQL Server version?