Unable to update database to match the current model because there are pending changes and automatic migration is disabled

后端 未结 5 818
渐次进展
渐次进展 2021-01-13 07:40

I, for the life of me, can\'t get rid of this error message. I have tried almost everything that I can.

MyDBContext.cs

        public MyDBContext() :         


        
5条回答
  •  粉色の甜心
    2021-01-13 07:54

    1. Delete your Migrations folder from your solution
    2. Delete the dbo.__MigrationHistory table from your database
    3. Open Package Manager Console and Enable-Migrations
    4. Add your initial migration Add-Migration Initial
    5. Update-Database
    6. Done

提交回复
热议问题