Is EF Core Add Migration Supported from .NET Standard Library?

后端 未结 5 2255
抹茶落季
抹茶落季 2020-12-24 12:37

We have been trying to run EF Core Migration in .Net Standard 1.6 class library, but it has been failing. But same passes very well in .Net Core 1.1 class library.

5条回答
  •  北海茫月
    2020-12-24 13:32

    I haven't tried with .Net Standard 1.6 but It does work for 2.0.

    Microsoft.EntityFrameworkCore.Tools.DotNet needs to be added to each of your class libraries that have a DbContext in them. Right click the project and select Edit *.csproj. Then, add the following:

      
        
      
    

    You can see a more in-depth tutorial here: EF 7 Migrations with multiple DBContexts

提交回复
热议问题