0

I´m facing an issue with dotnet ef since I moved to ef core 1.1.0. I'm used to use Add-Migration from Microsoft.EntityFrameworkCore.Tools, but aparently is not working with ef 1.1.0. I then changed to Microsoft.EntityFrameworkCore.Tools.DotNet to use dotnet ef, but I´m getting the following message -> No executable found matching command "dotnet-ef"

I tried several tips from other topics, but none worked for me. My project.json file is

{
  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.1.1",
      "type": "platform"
    },
    "Microsoft.AspNetCore.Diagnostics": "1.1.1",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.1.1",
    "Microsoft.AspNetCore.Server.Kestrel": "1.1.1",
    "Microsoft.Extensions.Logging.Console": "1.1.1",
    "Microsoft.AspNetCore.Razor.Tools": {
      "version": "1.0.0-preview4-final",
      "type": "build"
    },
    "Microsoft.AspNetCore.StaticFiles": "1.1.1",
    "Microsoft.AspNetCore.Mvc": "1.1.2",
    "Microsoft.Extensions.Configuration.Json": "1.1.1",
    "Microsoft.EntityFrameworkCore.SqlServer": "1.1.1",
    "Microsoft.EntityFrameworkCore.Tools.DotNet": "1.0.0-preview4-final"
  },

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

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

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

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

  "publishOptions": {
    "include": [
      "wwwroot",
      "web.config"
    ]
  }
}

Do someone have a clue? Thx!

  • `project.json` is not supported, you need to upgrade to VS2017 and convert your projects to csproj. – DavidG May 05 '17 at 11:27
  • Try removing or renaming your global.json if one exists in your project or solution folder it's possible it is referencing an older version of .netcore. – dynamiclynk May 05 '17 at 11:28
  • @davidg project.json wouldn't prevent the cli command from execution, but yeah you will need to execute 'dotnet migrate' on the folder containing project.json to spit out a csproj for onward compatibility, but I suspect it may not work if your still referencing an older version of dnc with a global.json – dynamiclynk May 05 '17 at 11:43
  • @wchoward, global.json is { "projects": [ "src", "test" ], "sdk": { "version": "1.0.0-preview2-003131" } } – João Paulo Morais May 05 '17 at 12:31
  • Yep rename it to like global.json_old and see if that make a difference. But you will need to still upgrade your dotnet 1.0 project.json to csproj 1.1 via dotnet migrate, or should automatically be upgraded if you open your xproj or project.json via vs2017. – dynamiclynk May 05 '17 at 12:32
  • More Info -> https://docs.microsoft.com/en-us/dotnet/articles/core/tools/project-json-to-csproj#the-csproj-format – dynamiclynk May 05 '17 at 12:38
  • @wchoward Yes I'm aware of that, my point is that people are much less likely to get help with .Net Core if they haven't migrated to a supported version. – DavidG May 05 '17 at 13:51
  • @davidg ok great point – dynamiclynk May 05 '17 at 13:58
  • Possible duplicate of [#37276882](https://stackoverflow.com/questions/37276882/no-executable-found-matching-command-dotnet-ef): in short words, you need to manually edit your project configuration file and add a reference to the Tools / Tools.DotNet packages (as VS2017 won't do that automatically). For further info, [read here](http://www.ryadel.com/en/no-executable-found-matching-command-dotnet-ef-error-in-visual-studio-2017-and-net-core-2-vs2017-entity-framework/). – Darkseal Aug 19 '17 at 05:53

0 Answers0