Home > Net >  EF migration try to run twice and throw exception
EF migration try to run twice and throw exception

Time:02-10

In a winforms application, with sdf database, I try to run a migration and return exception when update-database System.Data.SqlServerCe.SqlCeException (0x80004005): A duplicate value cannot be inserted into a unique index. [ Table name = __MigrationHistory,Constraint name = PK_dbo.__MigrationHistory ] , If I run again this command then it runs succesfully. In up method I try to add an object in database with entity framework. But migration seems that it try to run twice. How I can solve this problem?

CodePudding user response:

  •  Tags:  
  • Related