2

I have tried using the following command ( which works fine if I use Visual Studio) :

Scaffold-DbContext "Server=12.345.567.890;Database=ABC;Trusted_Connection=True;User Id=xyz;Password=12345;Integrated Security=false;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -f

While trying the above command using Visual Studio code terminal, I get this error:

The term 'Scaffold-DbContext' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again

2
  • 1
    Did you install Microsoft.EntityFrameworkCore.Tools package ? Commented Nov 15, 2017 at 7:01
  • Yes. Do I need to install something in Visual Studio Code editor? Commented Nov 15, 2017 at 8:24

1 Answer 1

13

You may have to run the command line version of scaffolding. The command you have posted is for the Package Manager in Visual Studio

dotnet ef dbcontext scaffold "Server=12.345.567.890;Database=ABC;Trusted_Connection=True;User Id=xyz;Password=12345;Integrated Security=false;" Microsoft.EntityFrameworkCore.SqlServer -o Models

Source ASP.NET Core - Write Apps with Visual Studio Code and Entity Framework

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.