Entityframework.docs: 'Scaffold-DbContext' is not recognized -> require EF Tools

Created on 31 Oct 2018  Â·  10Comments  Â·  Source: dotnet/EntityFramework.Docs

"If you receive an error stating The term 'Scaffold-DbContext' is not recognized as the name of a cmdlet, then close and reopen Visual Studio."

Actual solution is to install nuget package Microsoft.EntityFrameworkCore.Tools


Documentdetails

âš  Dit gedeelte niet bewerken. Het is vereist om problemen te koppelen tussen docs.microsoft.com en GitHub.

area-scaffolding closed-not-needed

Most helpful comment

To resolve this issue, you will have to run this command in the package manager console Install-Package Microsoft.EntityFrameworkCore.Tools before to run the Scaffold-DbContext command, hope it help !

All 10 comments

Yes, they should mention this in the instructions

Yes, especially since this page appears prominently in google search

Just hit by this.

thx for sharing.

I ran into this on a console app. Installing Microsoft.EntityFrameworkCore.Tools didn't help, even after a VS restart. I used the EF CLI to scaffold.

dotnet ef dbcontext scaffold "Server=.\;Database=AdventureWorksLT2012;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -o Model

Refer to this, it will make your life easier

https://docs.microsoft.com/en-us/ef/core/miscellaneous/cli/powershell

To resolve this issue, you will have to run this command in the package manager console Install-Package Microsoft.EntityFrameworkCore.Tools before to run the Scaffold-DbContext command, hope it help !

I had to start Visual Studio as an administrator to get it to work. Probably due to local policies in on our computers at my work...

@bricelam @Rick-Anderson It looks like ASP.NET tutorial gets the package through ASP.NET scaffolding, so it doesn't need to be explicitly installed. Do you think we should change anything here?

Yes, VS installs all the scaffolding packages and tools. If you select the VSC tab, it provides full instructions.

The meta-data in this issue points to our repo, why is this issue in the EF repo?

This page gets 22K PV/Month with a 92% CSAT.

Recommend closing.

Was this page helpful?
0 / 5 - 0 ratings