Efcore: Issues using Microsoft.EntityFrameworkCore.Tools 1.0.0-preview3-final

Created on 25 Oct 2016  路  6Comments  路  Source: dotnet/efcore

Following this guide but changing version on package Microsoft.EntityFrameworkCore.Tools to the preview3 when executes "dotnet ef" after "dotnet restore" fires up this error: No executable found matching command "dotnet-ef". And when I rollback to the preview2 but along with the package Microsoft.EntityFrameworkCore.Design on version 1.1.0-preview1-final gave another error dotnet quit unexpectedly (on window alert) and message error on terminal says: Unhandled Exception: System.MissingMethodException: Entry point not found in assembly 'Microsoft.EntityFrameworkCore.Design, Version=1.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
this occurs on "dotnet ef" after "dotnet restore"...

All this with Visual Studio Code on macOS Sierra

BTW this is my project.json that works well on dotnet ef execution and this is for a web api project

{
  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.0.1",
      "type": "platform"
    },    
    "Npgsql.EntityFrameworkCore.PostgreSQL": "1.0.2",    
    "Microsoft.EntityFrameworkCore.Design": {
      "version": "1.0.0-preview2-final",
      "type": "build" 
    },
    "Microsoft.AspNetCore.Mvc": "1.0.1",
    "Microsoft.AspNetCore.Routing": "1.0.1",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
    "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
    "Microsoft.Extensions.Configuration.Json": "1.0.0",
    "Microsoft.Extensions.Configuration.CommandLine": "1.0.0",
    "Microsoft.Extensions.Logging": "1.0.0",
    "Microsoft.Extensions.Logging.Console": "1.0.0",
    "Microsoft.Extensions.Logging.Debug": "1.0.0",
    "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0"
  },

  "tools": {
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final",
    "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final" 
  },

  "frameworks": {
    "netcoreapp1.0": {
      "imports": [
        "dotnet5.6",
        "portable-net45+win8"
      ]
    }
  },

  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true
  },

  "runtimeOptions": {
    "configProperties": {
      "System.GC.Server": true
    }
  },

  "publishOptions": {
    "include": [
      "wwwroot",
      "**/*.cshtml",
      "appsettings.json",
      "web.config"
    ]
  },

  "scripts": {
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  },

  "tooling": {
    "defaultNamespace": "API"
  }
}

Most helpful comment

The package listed in your tools section needs to be updated to Microsoft.EntityFrameworkCore.Tools.DotNet.

All 6 comments

The package listed in your tools section needs to be updated to Microsoft.EntityFrameworkCore.Tools.DotNet.

Ok thanks bricelam, adding that package on tools with the latest version fix the problem now dotnet ef runs correctly!

Closing this one out. The change required in the tools node is documented in the release post. The docs will cut over to 1.1 content once we RTM it.

@rowanmiller Thanks for the details. Here's a nuance: I'm having the same issue but my project is Asp.net Core on .Net Framework 4.6.1, and it seems EF.Tools.DotNet:1.1.0* is not available for net461. What dependencies and tools should I specify to be able to run ef commands?

@bricelam could you help out with the above question?

For now, you need to add it manually to the csproj (NuGet will enable installing from the UI later).

```xml


Was this page helpful?
0 / 5 - 0 ratings