The term “Add-Migration” is not recognized

后端 未结 18 2341
情深已故
情深已故 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:23

    I ran into the same issue. Most of my projects had the same thing in tools.

    "tools": {
        "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final"
    }
    

    This worked fine on all but one project. I changed the entry in tools to

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

    And then ran dotnet restore. After the restore completed, Add-Migration worked normally.

提交回复
热议问题