The string argument 'migrationId' cannot be empty

Viewed 1904

Apologies in advance if this has already been answered but I've honestly dug deep and could not find anything relating to this error.

In a nutshell, I am unable to make any updates to my database using code first within my ASP.NET Core 1.1.2 project. It's throwing an exception because it's missing an argument which I'm guessing is not to do with PMC.

Error message when using 'Update-Database':

Error-Image-Update-Database

Text for cross checking Google ;-)

    System.ArgumentException: The string argument 'migrationId' cannot be empty.
   at Microsoft.EntityFrameworkCore.Utilities.Check.NotEmpty(String value, String parameterName)
   at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.GetAppliedMigrations()
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
   at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String contextType)
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.<>c__DisplayClass0_1.<.ctor>b__0()
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
The string argument 'migrationId' cannot be empty.

The Migrations folder is identical to my '_EFMigrationsHistory' table (ignoring the last migration which is scheduled for update):

enter image description here

I've even gone as far as removing the Migrations folder and '_EFMigrationsHistory' table and starting again which presented the same error. I was also going to test 'v2.0.0-preview2-final' just in case it was a bug, but sadly my version of VS only takes release builds and apparently you need 15.3.

Version Info:

  • Visual Studio Enterprise 2017 - 15.2 (26430.16) Release
  • Entity Framework Core v1.1.2
  • ASP.NET Core v1.1.2

Any pointers would be much appreciated.

Edit

@DavidG

For dotnet ef database update

enter image description here

and for Update-Database -TargetMigration AdUserImage

enter image description here

1 Answers
Related