Build failed. - error creating migration

Asked

Viewed 160 times

-1

Good afternoon.

I am starting a web project that is generating an error using the command: "dotnet Ef database drop" I used at the end of the -v command to generate a complete message.

Error message:

Build failed.

1 Error(s)
Microsoft.EntityFrameworkCore.Tools.CommandException: Build failed.
   at Microsoft.EntityFrameworkCore.Tools.Project.Build()
   at Microsoft.EntityFrameworkCore.Tools.RootCommand.Execute()
   at Microsoft.DotNet.Cli.CommandLine.CommandLineApplication.Execute(String[] args)
   at Microsoft.EntityFrameworkCore.Tools.Program.Main(String[] args)

I’ve already set up the ConnectionString; inserted all the PackageReference of entity in the csproj created the model and context I configured the program.Cs class configured the startup class

Where am I going wrong?

1 answer

0

Make sure your project compiles correctly before executing the commands dotnet ef.

Errors can be checked by your IDE (like visual studio) out editor (like VS Code), out even from the command line, with dotnet build.

After correcting all build errors it should be possible to run the Entity framework commands.

  • I wasn’t compiling any, but I was. I checked the bugs by the IDE and reinstalled again , after which the bugs were fixed and I created a new project folder and it worked fine.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.