Search code examples
c#asp.net-mvcvisual-studionuget

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


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.

Solution

    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.