Entity Framework Core 2.0 add-migration not generating anything

后端 未结 2 584
醉话见心
醉话见心 2021-01-12 18:02

I\'m new to EF and am trying to create a simple test solution using VS 2017, .NET Core 2.0 and EF 2.0 but I can\'t get add-migration to create the migrations folder

2条回答
  •  囚心锁ツ
    2021-01-12 18:27

    @JulieLerman provided the answer when I asked in her pluralsight course discussion. There is apparently an issue with attempting this with the .NET Core class libraries. The successful workaround is to put the following in the csproj file of the DBContext project:

    
      true 
    
    

    She wrote a blog about it: http://thedatafarm.com/data-access/the-secret-to-running-ef-core-2-0-migrations-from-a-net-core-or-net-standard-class-library/

    Additionally, be sure to set the project with the DBContext in it as the startup project

提交回复
热议问题