The term ‘Scaffold-DbContext’ is not recognized as the name of a cmdlet, function, script file, or operable program.

If you’re trying to scaffold a database in Entity Framework Core for the first time in your project you might get the following error…

The term ‘Scaffold-DbContext’ is not recognized as the name of a cmdlet, function, script file, or operable program.

To resolve you need to install the…

Microsoft.EntityFrameworkCore.Tools

NuGet package. Do this from the Package Manager Console by running the following command…

Install-Package Microsoft.EntityFrameworkCore.Tools

or by right-clicking on your project and selecting ‘Manage NuGet Packages…’

Be sure to save the project after installing the package before trying the Scaffold-DbContext command again.

Leave a Reply

Your email address will not be published.