0
votes

When I want to add Entity Framework migration to my ASP.NET Core 1.1 by run "dotnet ef migrations add InitialCreate" get this error

"No executable found matching command "dotnet-ef"".

After google this error i wanted to add Microsoft.EntityFrameworkCore.Tools.DotNet Package to project but in console get this:

"Install-Package : Package 'Microsoft.EntityFrameworkCore.Tools.DotNet 1.0.1' has a package type 'DotnetCliTool' that is not supported by project"

and this is project.json:

{ "tools": { "Microsoft.EntityFrameworkCore.Tools": "1.1.1" } }

What should I do exactly to enable migration in my project?

2

2 Answers

1
votes

The project.json tooling never RTMed. You should upgrade to Visual Studio 2017 (and the .NET Core SDK 1.0.4).

If you really want to continue using project.json, it should look like this (But realize it's unsupported)

{
    "dependencies": {
        "Microsoft.EntityFrameworkCore.SqlServer": "1.1.1",
        "Microsoft.EntityFrameworkCore.Design": {
            "version": "1.1.1",
            "type": "build"
        }
    },
    "tools": {
        "Microsoft.EntityFrameworkCore.Tools.DotNet": "1.0.0-preview4-final"
    }
}
0
votes

Changing the version to 2.0.2 for "Microsoft.EntityFrameworkCore.Tools" should work