{"action":"created","issue":{"url":"https://api.github.com/repos/mrahhal/Migrator.EF6/issues/9","repository_url":"https://api.github.com/repos/mrahhal/Migrator.EF6","labels_url":"https://api.github.com/repos/mrahhal/Migrator.EF6/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/mrahhal/Migrator.EF6/issues/9/comments","events_url":"https://api.github.com/repos/mrahhal/Migrator.EF6/issues/9/events","html_url":"https://github.com/mrahhal/Migrator.EF6/issues/9","id":158785595,"number":9,"title":"Command Exception: No executable name found matching command \"dotnet-ef\"","user":{"login":"ilmax","id":3263338,"avatar_url":"https://avatars.githubusercontent.com/u/3263338?v=3","gravatar_id":"","url":"https://api.github.com/users/ilmax","html_url":"https://github.com/ilmax","followers_url":"https://api.github.com/users/ilmax/followers","following_url":"https://api.github.com/users/ilmax/following{/other_user}","gists_url":"https://api.github.com/users/ilmax/gists{/gist_id}","starred_url":"https://api.github.com/users/ilmax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilmax/subscriptions","organizations_url":"https://api.github.com/users/ilmax/orgs","repos_url":"https://api.github.com/users/ilmax/repos","events_url":"https://api.github.com/users/ilmax/events{/privacy}","received_events_url":"https://api.github.com/users/ilmax/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-06-06T22:01:35Z","updated_at":"2016-06-17T09:45:26Z","closed_at":"2016-06-07T17:43:00Z","body":"Hi, when using EF6 in a core class library, after running the command e.g. `dotnet ef migrations enable`, I'm hitting this exception:\r\n\r\n` Microsoft.DotNet.Cli.Utils.CommandUnknownException: No executable found matching command \"dotnet-ef\"`\r\n\r\nI've put together a small sample demonstrating the issue, you can find it [here](https://github.com/ilmax/dotnet-ef-sample)\r\n\r\n### Steps to repro\r\n- Clone\r\n- Compile\r\n- cd WebApp.Data\r\n- dotnet-ef migrations enable\r\n\r\n### Expected output:\r\nMigrations enabled as expected\r\n\r\n### Actual output:\r\n```\r\nUnhandled Exception: Microsoft.DotNet.Cli.Utils.CommandUnknownException: No executable found matching command \"dotnet-ef\"\r\n   at Microsoft.DotNet.Cli.Utils.ProjectDependenciesCommandFactory.FindProjectDependencyCommands(String commandName, IEnumerable`1 commandArgs, String configuration, NuGetFramework framework, String outputPath, String buildBasePath, String projectDirectory)\r\n   at Microsoft.DotNet.Cli.Utils.ProjectDependenciesCommandFactory.Create(String commandName, IEnumerable`1 args, NuGetFramework framework, String configuration)\r\n   at Microsoft.Extensions.Internal.DotnetToolDispatcher.CreateDispatchCommand(IEnumerable`1 dispatchArgs, NuGetFramework framework, String configuration, String outputPath, String buildBasePath, String projectDirectory, String toolName)\r\n   at Microsoft.Extensions.Internal.DotnetToolDispatcher.CreateDispatchCommand(IEnumerable`1 dispatchArgs, NuGetFramework framework, String configuration, String outputPath, String buildBasePath, String projectDirectory)\r\n   at Migrator.EF6.Tools.Program.Dispatch(String[] args)\r\n   at Migrator.EF6.Tools.Program.Main(String[] args)\r\n```\r\n\r\nPlease note that everything is working as expected if EF6 is placed in the startup application.\r\n\r\nAm I missing something?"},"comment":{"url":"https://api.github.com/repos/mrahhal/Migrator.EF6/issues/comments/226727411","html_url":"https://github.com/mrahhal/Migrator.EF6/issues/9#issuecomment-226727411","issue_url":"https://api.github.com/repos/mrahhal/Migrator.EF6/issues/9","id":226727411,"user":{"login":"sagoo33","id":3021022,"avatar_url":"https://avatars.githubusercontent.com/u/3021022?v=3","gravatar_id":"","url":"https://api.github.com/users/sagoo33","html_url":"https://github.com/sagoo33","followers_url":"https://api.github.com/users/sagoo33/followers","following_url":"https://api.github.com/users/sagoo33/following{/other_user}","gists_url":"https://api.github.com/users/sagoo33/gists{/gist_id}","starred_url":"https://api.github.com/users/sagoo33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sagoo33/subscriptions","organizations_url":"https://api.github.com/users/sagoo33/orgs","repos_url":"https://api.github.com/users/sagoo33/repos","events_url":"https://api.github.com/users/sagoo33/events{/privacy}","received_events_url":"https://api.github.com/users/sagoo33/received_events","type":"User","site_admin":false},"created_at":"2016-06-17T09:45:26Z","updated_at":"2016-06-17T09:45:26Z","body":"Hello, I also had this issue, and found that I also had to add a Program.cs with a main entry point and an initializer for the DataContext as well as putting \"emitentrypoint\": true in the project.json :\r\n\r\nThis is only used in development however, the main web project doesn't need this.\r\n\r\n` public class Program\r\n    {\r\n        public static void Main(string[] args)\r\n        {\r\n            \r\n        }\r\n    }\r\n\r\n    public class MigrationsContextFactory : IDbContextFactory<DAContext>\r\n    {\r\n        public DAContext Create()\r\n        {\r\n            return new DAContext(\"sqlconnectionstring\");\r\n        }\r\n    }`"}}
{"actor":{"display_login":"sagoo33"}}