New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No executable found matching command "dotnet-ef" even after adding CLI #8996
Comments
Ensure...
|
Yes, i am using 2.0 SDK and tried for dotnet restored on project but still got same error. |
I am uploaded entire solution on github. CodeFirst is a project, which i want to Migrate and generate error. |
Align your package versions. |
Also to use |
Added |
Does running |
yes, project build successfully. But gives only error for CLI |
...and you're certain |
(I know these are stupid questions, but I honestly have no idea what could be going wrong.) |
You may need to follow up on dotnet/cli. Something is going wrong before the EF code gets a chance to run. |
|
If you want to check on my machine then i will give remote access, so you can see what's going wrong. |
I cloned the repo posted. <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
<UserSecretsId>aspnet-CodeFirst-DB7142CA-3EB8-4FB3-9C4A-0173586B87FB</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0-preview1-final" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.0.0-preview1-final" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.0.0-preview1-final" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="2.0.0-preview1-final" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.0-preview1-final" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0-preview1-final" />
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0-preview1-final" />
</ItemGroup>
</Project> In the directory I had to remove PackageTargetFallback due to this NuGet/NuGet.Client#1495 and I could not find where AssetTargetFallBack is set. |
@smitpatel Thanks a lot for solving this issue ;) |
By default Package Manager Console (PMC) is rooted at dir containing the solution file. For best user experience, use PMC commands for EF (Add-Migration & friends) in PMC. |
I has this issue and like to share. i had the when i changed it to eg Use: |
That last thing worked for me My God, this library mangement is from github, orginally a core 1.1 web app I hope realy with 2.0 and webpack things will be stable and change too much. |
This worked for me:
|
I hade the some trouble and I fix this change the Microsoft.EntityFramework.Tools.Dotnet from the First <PackageReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" /> For a second <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" /> |
It's a pity for new one(.net core user).
in powershell
Is there is a simple way to use this commands or have a good tutorial? |
I have just started playing with .Net Core. I am running into issues with |
Stack trace as below: |
@amazingankur Where you able to solve your problem? In any case you still have issues with IDesignTimeDbContextFactory, make sure your DataContext class has a default constructor with no parameters in it. The migration script uses the parameterless constructor during execution. |
I experienced this issue as well Just like what @AliBayatGH @veneMarcos @timpur mentioned it appears as if the |
To those who may stumble this page looking for answers I have provided codes here in github that can be cloned: https://github.com/jlenriquez/SpikeSQLiteEF_OSX The sample code can be run step-by-step by commenting/uncommenting necessary steps and can be used as learning reference. |
The EF Core .NET Command-line Tools docs may also be helpful. |
I fixed this by adding this to my
This line was already there, After that then restore the packages by running |
|
I followed this thread and am getting the following
Any thoughts? |
@ravensorb - You are mixing packages from 2.0 & 2.1 release. Please make sure all packages from EF Core are on same release cycle include EFCore.Tools |
Go to the folder where .csproj is and run “dotnet restore" first |
Expliciting changing to my csproj folder and running "dotnet restore" worked for me. First i confirmed if my PackageReference and DotNetCliToolReference were correct, i had two add two missing references. Thks |
you might miss the CliToolReference references: <ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.0" />
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" /></ItemGroup> |
I have done something worked for me: |
After adding this : <ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.2" />
</ItemGroup> It works !
|
My problem was that my |
@oising was the answer for me, using 3.0.0-preview but creating 2.2 projects.
|
I'm using the newly released .NET Core 3.0 with packages in the CSPROJ all being 3.0 but Edit: to @bricelam's answer below, I found documentation for this in https://docs.microsoft.com/en-us/ef/core/miscellaneous/cli/dotnet#ef-core-3x. |
dotnet tool install -g dotnet-ef |
I have that and all above and still have no dotnet ef option when I do dotnet -h and get same error when I issue dotnet ef |
None of the above worked. Here is my proj
after I run
I still see no ef tool when I run dotnet -h
However, issuing dotnet ef shows the screen
Having said that, I am not sure this is good solution, shouldn't ef tool be in project folder version rather than global version? |
@dinob68 - I am not able to understand why would |
|
@dinob68 Think of it like a test runner. You don’t need to use an exact version of the runner or use a specific version of the testing framework. One runner will work with multiple versions of the test framework, and more than one version of the runner can be used with the same framework. |
This worked for me, thanks. |
I want to Migrate my Database with Models. I am using EF Core 2.0 Preview.
Packahe & Tools
I am already added all CLI and PM but still got error!
Further technical details
EF Core version: 2.0 Preview
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: Windows 10 15063.0
IDE: Visual Studio 2017 Preview
The text was updated successfully, but these errors were encountered: