efcore icon indicating copy to clipboard operation
efcore copied to clipboard

No executable found matching command "dotnet-ef" on Ubuntu

Open aswanevelder opened this issue 9 years ago • 4 comments

Trying to do a dotnet ef database update on Ubuntu 16.04

root@CSDA:/var/csda# dotnet ef database update No executable found matching command "dotnet-ef"

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

.NET Core SDK 1.0 rc4 build 004771 installed on Ubuntu

If I try to add the Install-Package Microsoft.EntityFrameworkCore.Tools.DotNet -Pre I get this error

Package 'Microsoft.EntityFrameworkCore.Tools.DotNet 1.0.0-msbuild1-final' has a package type 'DotnetCliTool' that is not supported by project

aswanevelder avatar Feb 16 '17 12:02 aswanevelder

@aswanevelder

  1. Do you Microsoft.EntityFrameworkCore.Tools.DotNet package listed in your csproj?
  2. Were you using dotnet ef in windows or powershell commands?

smitpatel avatar Feb 16 '17 15:02 smitpatel

Dupe of NuGet/Home#4190. Until then, manually add it to your *.csproj:

<ItemGroup>
  <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet"
                          Version="1.0.0-msbuild3-final" />
</ItemGroup>

bricelam avatar Feb 16 '17 16:02 bricelam

That is in and works on Windows, for some reason not on Ubuntu. I created this project with the latest VS 2017 RC release.

<ItemGroup>
    <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.0.0-msbuild3-final" />
    <DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="1.0.0-msbuild3-final" />
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0-msbuild3-final" />
  </ItemGroup>

aswanevelder avatar Feb 17 '17 06:02 aswanevelder

@aswanevelder The .NET Core SDK RTMed today. Could you try again? If you're still having issues, could you submit a new issue on the dotnet/cli repo?

bricelam avatar Mar 07 '17 17:03 bricelam