The term “Add-Migration” is not recognized

后端 未结 18 2328
情深已故
情深已故 2020-12-07 23:51

I\'m using this MSDN Tutorial to run in VS2015 the command PM> Add-Migration MyFirstMigration -context BloggingContext that ran yesterday successfully but to

18条回答
  •  情书的邮戳
    2020-12-08 00:37

    Try the following steps:

    1) Open project.json file and Remove all Microsoft.EntityFrameworkCore.Tools references from dependencies and tools sections.

    2) Close Package Manager Console (PMC) and restart Visual Studio

    3) Add under dependencies section:

     "Microsoft.EntityFrameworkCore.Tools": {
      "version": "1.0.0-preview2-final",
      "type": "build"
     }
    

    4) Add under tools section

    "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final"
    

    5) Restart again Visual Studio 2015

    6) Open the PMC and type

    Add-Migration $Your_First_Migration_Name$
    

    This happen because the PMC recognize the tools when Visual Studio is starting.

提交回复
热议问题