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

Created on 16 Feb 2017  路  4Comments  路  Source: dotnet/efcore

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

closed-external

Most helpful comment

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>

All 4 comments

@aswanevelder

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

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>

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 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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bgribaudo picture bgribaudo  路  3Comments

miguelhrocha picture miguelhrocha  路  3Comments

julienshepherd picture julienshepherd  路  3Comments

januszj picture januszj  路  3Comments

leak picture leak  路  3Comments