This version of the Entity Framework Core Package Manager Console Tools doesn't support these types of projects

后端 未结 3 850
一向
一向 2021-01-20 12:46

After updating an existing project to ASP.NET Core 1.1 and Entity Framework Core 1.1 using this tutorial
I tried to execute \"Add-Migration MigrationName\" in Package Ma

3条回答
  •  野的像风
    2021-01-20 13:12

    As per official ASP.NET Core team announcement (see GitHub) the Microsoft.EntityFrameworkCore.Tools package was split into Microsoft.EntityFrameworkCore.Tools and Microsoft.EntityFrameworkCore.Tools.DotNet.

    You need to reference the later one, if you want to continue to use the dotnet ef commands. If you only want to use the old powershell styled commands (Database-Update, Add-Migration, etc.) the old package should be sufficient.

    When referencing Microsoft.EntityFrameworkCore.Tools.DotNet``there is no need to also reference ``Microsoft.EntityFrameworkCore.Tools.

    Quote by Rowan Miller

    If you are using ASP.NET Core, then you need to update the tools section of project.json to use the new Microsoft.EntityFrameworkCore.Tools.DotNet package (rather than the Microsoft.EntityFrameworkCore.Tools package).

    "tools": {
      "Microsoft.EntityFrameworkCore.Tools.DotNet": "1.0.0-preview3-final" 
    },
    

    As the design of .NET CLI Tools has progressed, it has become necessary for us to separate the dotnet ef tools into this separate package. Microsoft.EntityFrameworkCore.Tools is still used for Package Manager Console commands.

    Now that EF Core is released it should be of course

     "tools": {
       "Microsoft.EntityFrameworkCore.Tools.DotNet": "1.0.0" 
     },
    

    Also please note, that the tools do not share the version with the EF itself. The latest version of the tools is still 1.0.0 for Tools.DotNet(see Nuget) and 1.1.0 for Tools (see Nuget again).

提交回复
热议问题