Scaffold-DbContext failed to build, how do i resolve this issue on Nuget console?

Viewed 2079

I have installed all required packages for this command, when i try to run this command on my console its failed to build. Kindly please assist to resolve this issue, thanks.

PM> Scaffold-DbContext "Server=Gcobanim-L\SQLEXPRESS;Database=eNtsaRegistration;Trusted_Connection=True" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models
Build started...
Build failed.
2 Answers
  1. First rebuild the project and see any errors and were fixed.

  2. Execute the command again and ran successfully without any issue.

  3. Update-Database also build successfully.

For command line tool dotnet ef dbcontext scaffold there is a flag --no-build:

--no-build Don't build the project. Intended to be used when the build is up-to-date.

Related