Entityframework Aspnet Core Migrations

Asked

Viewed 76 times

3

Good evening, I came across a problem to update the DB of an Aspnet Core application. Had created the bank, but ended up deleting, now, while trying to create again using the following commands:

dotnet ef migrations Initial 
dotnet ef database update

When executing the first command I receive the following message:

D:\PROGRAMACAO\FONTES\ASPNET\LIVRO\FilmeMvc\src\FilmeMvc>dotnet ef migrations add InitialProject FilmeMvc (.NETCoreApp,Version=v1.0) was previously compiled. Skipping compilation. Done. To undo this action, use 'dotnet ef migrations remove'

I removed the entire application, I redid it again, By adding the first command in 'Developer Command Prompt for VS2015' I get the message quoted. How could I resolve this issue.

  • You have to remove (delete) and recompile (Rebuild) the project.

  • 1

    @Marconciliosouza, thanks for the tip, I was deleting, but I was not recompiling the project, I did what guided me and everything went right.

2 answers

0

Resolution: After deletion, performed Rebuild, resolved what was occurring.

0

Delete the data from the Migrationhistory table or run dotnet Ef Migrations remove as the message suggests.

  • Good evening. I already executed the command mentioned, however, when recreating, returns the same message.

Browser other questions tagged

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