Enable-Migrations Exception calling “SetData” with “2” argument(s)

后端 未结 8 1698
小鲜肉
小鲜肉 2020-11-29 09:45

I created a library based on .NET 4.6.2 version.
To the library, I\'ve added the EntityFramework version 6.1.3 package.
I created a model as follow



        
相关标签:
8条回答
  • 2020-11-29 10:44

    This error occured to me today, after I cloned an old-ish project which was still configured to run on asp.net Core Rc2. After I installed 1.1 and changed all the variables the error persisted.

    The solution in my case was to reboot. The installation of Asp.net Core 1.1 wasn't finished yet.

    0 讨论(0)
  • 2020-11-29 10:45

    Other answers suggest this is an issue with your startup project.

    As your project is a library, you could try setting your unit test project as your startup project per this answer.

    You could also try setting the default project in Package Manager Console to your library project per the accepted answer here.

    You might run into issues with where the migrations are created. If you need further control, in EF6 there are various arguments you can use with Enable-Migrations as detailed in this answer but I don't have enough knowledge in this area to guide you further. You might need to do some reading.

    0 讨论(0)
提交回复
热议问题