efcore icon indicating copy to clipboard operation
efcore copied to clipboard

No executable found matching command "dotnet-ef" on Ubuntu (.Net Core 1.1)

Open aswanevelder opened this issue 9 years ago • 2 comments

As per issue #7629 closed

I previously confused this to be isolated just to Ubuntu, but this happens on any Published ASP.Net Core solution.

Trying to do a dotnet ef database update on published folder

\bin\Release\PublishOutput>dotnet ef database update No executable found matching command "dotnet-ef"

Steps:

  1. Create Asp.net core application in VS 2017 on Windows
  2. Add Code First models
  3. Add SapientGuardian.EntityFrameworkCore.MySql package
  4. Change DbContext to UseMySQL
  5. Works under Solution command
  6. Publish to Folder
  7. Run dotnet ef database update
  8. Error

Please note latest version installed:

  • sudo apt-get install dotnet-dev-1.0.1
  • all previous .net version removed as per script instructions

Solution built with latest Visual Studio 2017 as released on 2017-03-07

Same error as before.

Also there is now only a version 1.0 of Microsoft.EntityFrameworkCore.Tools.DotNet.

Would appreciate your assistance.

> root@WCGOV:/var/www/mll# dotnet ef database update
> 
> Welcome to .NET Core!
> ---------------------
> Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs.
> 
> Telemetry
> --------------
> The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community.
> You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell.
> You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry.
> 
> Configuring...
> -------------------
> A command is running to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
> Decompressing 100% 9729 ms
> Expanding 100% 46649 ms
> No executable found matching command "dotnet-ef"
> root@WCGOV:/var/www/mll# dotnet ef database update
> No executable found matching command "dotnet-ef"
> root@WCGOV:/var/www/mll#
> 

aswanevelder avatar Mar 08 '17 13:03 aswanevelder

Need to investigate this further on my side. Something to do with the Microsoft.EntityFrameworkCore.Tools.DotNet that need to be published.

aswanevelder avatar Mar 08 '17 14:03 aswanevelder

My issue was resolved by adding these to project.json "tools": { "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final", "Microsoft.EntityFrameworkCore.Tools.DotNet": "1.1.0-preview4-final" }

then execute these 2 commands:

  1. dotnet restore -> to restore packages
  2. dotnet ef migrations add MyMigration

All the credit goes to: http://know-it.ru/2017/03/15/dotnet-exe-no-executable-found-matching-command-dotnet-ef/

etrupja avatar Mar 29 '17 09:03 etrupja