Unable to generate an explicit migration because the following explicit migrations are pending: [201904241217409_EditScrip5]. Apply the pending explicit migrations before attempting to generate a new explicit migration.
我的解决办法简单粗暴
把脚本文件删除了,重新来一变,毕竟表结构变了,也无所谓了
把蓝色的文件删除了重新生成:
按顺序执行下面三个命令:
Enable-Migrations -ProjectName XX.PhotoGallery.DAL -StartUpProjectName XX.PhotoGallery.WebPlatform -Verbose
Add-Migration -Name EditScrip -ProjectName XX.PhotoGallery.DAL -StartUpProjectName XX.PhotoGallery.WebPlatform -Verbose
Update-Database -Script -ProjectName XX.PhotoGallery.DAL -StartUpProjectName XX.PhotoGallery.WebPlatform -Verbose