DropCreateDatabaseIfModelChanges EF6 results in System.InvalidOperationException: The model backing the context has changed

前端 未结 5 1187
后悔当初
后悔当初 2021-02-02 15:43

After migrating to Entity Framework 6 I get an error when executing unit tests on the build server.

I\'m using the DropCreateDatabaseIfModelChanges initiali

5条回答
  •  盖世英雄少女心
    2021-02-02 16:03

    This is throwing because you have migrations enabled and you are using the DropCreateDatabaseIfModelChanges initializer. Entityframework does not support using this initializer with migrations. You have two options:

    • Disable the initializer

    or

    • Disable migrations by removing the migrations configuration

提交回复
热议问题