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

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.

Leave a Comment