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

后端 未结 8 1746
小鲜肉
小鲜肉 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:42

    Edit: Simple fix (as stated above) -StartupProjectName YourEF6ProjectNameHere

    When I had been using the wrong StartupProjectName I still got the error. That's when I was using the solution below:

    My kludgy work-around is to unload the project that does not require EF migrations:

    1. Unload the startup project (in my case an ASP.Net Core project). Right-click the project name and selecting Unload Project.
    2. Run the needed migration commands in the Package Manager Console
    3. Right-click the unloaded project and choose Reload Project
    4. Right-click the same project and choose Set as StartUp Project.

    Not fun.

提交回复
热议问题