Efcore: No executable found matching command "dotnet-ef" error without project.json file

Created on 29 Dec 2016  路  4Comments  路  Source: dotnet/efcore

I've a VSTO - AddIn project developed using VS2015-Update3. I'm trying to implement a Database functionality in the project and for that I'm implementing EF Core. I'm using the following official MSDN tutorial. But I'm getting the above error when I run the command dotnet ef migrations add MyFirstMigration.

Please Note:

  1. VSTO-AddIn projects do not have a project.json file.
  2. VSTO projects use Full .NET framework (I'm using .NET 4.6.2). But, as explained here, one can use EF Core in a Full .NET framework.

Most helpful comment

For me, the Add-Migration or Update-Database commands won't work because I'm using a .csproj project, apparently. But I also had the same dotnet ef issues.

In the Package Manager Console (or whichever CLI you're using) make sure you cd to your project folder. The folder that typically contains your .json files, if you didn't move them. From there, the dotnet ef commands should work.

All 4 comments

Use the PMC commands (Add-Migration) instead.

@ErikEJ I had tried that first, but got the well know error: Add-Migration : The term 'Add-Migration' is not recognized as the name of a cmdlet....etc., etc. In MVC projects, this error generally goes away if I close and then re-open the VS2015. But not in this particular project. So, I ended up using the above command instead - but to no vail.

For me, the Add-Migration or Update-Database commands won't work because I'm using a .csproj project, apparently. But I also had the same dotnet ef issues.

In the Package Manager Console (or whichever CLI you're using) make sure you cd to your project folder. The folder that typically contains your .json files, if you didn't move them. From there, the dotnet ef commands should work.

Can you try on the latest tooling (see https://github.com/aspnet/EntityFramework/issues/7358 for details) and file new issues for things that you hit.

Was this page helpful?
0 / 5 - 0 ratings