efcore icon indicating copy to clipboard operation
efcore copied to clipboard

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

Open saf-itpro opened this issue 9 years ago • 4 comments

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.

saf-itpro avatar Dec 29 '16 03:12 saf-itpro

Use the PMC commands (Add-Migration) instead.

ErikEJ avatar Dec 29 '16 07:12 ErikEJ

@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.

saf-itpro avatar Dec 29 '16 15:12 saf-itpro

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.

asleight avatar Dec 29 '16 18:12 asleight

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.

rowanmiller avatar Jan 27 '17 23:01 rowanmiller