Cannot start "dotnet ef" on EF6 after upgrading to .NET Core 1.0 project files

After updating all the project.json files in the new format for the .NET kernel, I cannot run "dotnet ef" to migrate Entity Framework 6. Can anyone understand what is wrong with project.json below?

Before my project.json looked like this:

{ "frameworks": { "dnx46": { "dependencies": { } } }, "dependencies": { "EntityFramework": "6.1.3", "EntityFramework.DynamicFilters": "1.4.8-*", "Migrator.EF6": "1.1.0", .... }, "commands": { "ef": "Migrator.EF6" } } 

Now it looks like this:

  { ... "frameworks": { "net46": { "dependencies": { } } }, "dependencies": { "EntityFramework": "6.1.3", "Microsoft.EntityFrameworkCore.SqlServer.Design": "1.0.0", "EntityFramework.DynamicFilters": "1.4.8-*", "Migrator.EF6": "1.2.0", "Migrator.EF6.Tools": { "version": "1.0.3", "target": "package", "type": "build" }, ... }, "tools": { "Migrator.EF6.Tools": { "version": "1.0.3", "imports": "portable-net45+win8+dnxcore50" } } } 

This is the error message that I mean when running "dotnet ef":

Unhandled exception: Microsoft.DotNet.Cli.Utils.CommandUnknownException: no executable found matching command "dotnet-ef"

+2
entity-framework .net-core
Sep 08 '16 at 12:04 on
source share
1 answer

You must add this to your project.json file.

 "buildOptions": { "emitEntryPoint": true } 

In addition, if you do not have a main class, add an empty Main class as follows:

 public class Program { public static void Main(string[] args) { } } 
+3
Sep 08 '16 at 12:18
source share



All Articles