Cannot enable migrations for Entity Framework in class library

前端 未结 2 1693
滥情空心
滥情空心 2020-12-05 22:21

I just got on board with EF 5 and am using their code-first migrations tool but I seem to get an error when I try to enable migrations.

I type Enable-Migration

相关标签:
2条回答
  • 2020-12-05 23:07

    There are actually 3 ways to make Nuget commands run in a specific project:

    1. [Package Manager Console] Set the active project in the dropdown at the top of the console toolwindow
    2. [Package Manager Console] Look for a parameter to specify the project. For some cmdlets I've seen -ProjectName and some use -Project
    3. [Solution Explorer] Right-click the project you want, and use the graphical package manager window (Manage NuGet Packages...).
    0 讨论(0)
  • 2020-12-05 23:16

    Oh wow, nevermind. I'm dumb.

    In the Nuget package manager console there is a dropdown menu at the top labeled "Default Project:". Make sure you set that to the project you want to run the command against.

    Hopefully this helps someone else avoid my embarrassing mistake.

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