I’m building a website and API service using ASP.NET Core and EF Core with Visual Studio Code and the .NET Core CLI tooling on a Mac. I decided to try the recent 1.1 releases and ran into an unexpected headache: After updating, I get a No executable found matching command “dotnet-ef” result when I attempt to launch any EF core command, i.e., “dotnet ef –help”, in the terminal window.
Googling the issue led to lots of pre-1.0 release defects seen when working on library projects. In my case, I’m working on an app, so those solutions didn’t apply. I decided to review the EF Core 1.1 release announcement on the MS blog again. I found this nugget of information under the Upgrading tooling packages section. Trust me, it can easily be overlooked.
If you are using ASP.NET Core and the dotnet ef commands, then you need to update the tools section of project.json to use the new Microsoft.EntityFrameworkCore.Tools.DotNet package in place of the Microsoft.EntityFrameworkCore.Tools package from 1.0. As the design of .NET CLI Tools has progressed it has become necessary for us to separate the dotnet ef tools into this separate package.
json
"tools": {
"Microsoft.EntityFrameworkCore.Tools.DotNet": "1.1.0-preview4"
},
So, yeah… appending “.DotNet” to the “Microsoft.EntityFrameworkCore.Tools” entry (along with the expected version number updating) did the trick for me. I hope you’ll find this helpful if you run into the same problem after updating EF Core to the 1.1 release.
Leave a Reply