-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
dotnet ef
does not work after running dotnet tool install -g dotnet-ef
#15448
Comments
Just hit by exactly the same scenario here: After installing the tools using the same command line. I was working through this tutorial : https://docs.microsoft.com/en-us/ef/core/get-started/netcore/new-db-sqlite Just to make sure my tooling was working in the latest V3 sdk preview Cheers |
The workaround for .NET Core 3.0 SDK users is to run
|
@natemcmaster Awesome thanks. :-) I'm was under the impression it was something to do with the builds still being in preview, so I assume this will just automatically fix itself once DNC3 goes prod. |
The behavior on 3.0 is expected because
We will discuss this in triage, but for now this feels like a |
I agree to be fair. I don't expect a fix per say, but what might be an idea is to borrow from the NuGet screen in VS, where there is a tick box that says "consider previews", and implement something like that, either via a command line option, or an environment variable. The only reason I suggest this, is because folks like me don't always/or are not always privy to the actual versions we need for a given core tooling version. In my case above, I defaulted to the * in my install simply because I didn't expect any different, once it was pointed out I needed a specific version, and the version was given it was obvious, and the penny dropped. There are however many developers now converting to use Core, that don't have the benefit of experience, and so will blindly type in any command line version combo there told too, thus making more work for the support teams when things inevitably go wrong for them. Having a "tick" that can be enabled (Disabled by default) that allows the command to stop, look at it's actual version and see if there is a preview that matches it, would them mean support is as easy as "add the -foo parameter to your command line" Just my thoughts on things, not really expecting any note to be taken of them :-) Shawty |
I had the same issue with .NET Core 2.2 after i have installed .NET Core 3.0 Preview when i try to execute
i get
then i did run the command
then i tried with
again then i got this error
and when i have checked this path i found that it installs it as
so i had to rename the folders manually to match and it worked fine |
@AhmedHemdan21 The more appropriate workaround is to install with a preview version specified, as shown above and in the announcement. |
I concur with @ajcvickers renaming and/or messing about with the paths, folders and installed commands can never be a good thing, using the version suffix above is the safest way of ensuring you don't break anything even accidentally. |
I'm sure anyone reading through all this would understand this but what you really should do is head to Nuget and use the latest version (assuming you've just installed the latest 3.0 preview SDK), which for me, getting here after installing preview5 was not what is referenced, of course. I went here and checked: https://www.nuget.org/packages/Microsoft.EntityFrameworkCore/3.0.0-preview5.19227.1 and used preview5 instead. Just worth being explicit just in case ;-) |
I was working on an older app .net core 2.0 and for me the solution was
followed by
Then I could run
|
Where I can find a list with all versions of dotnet tools? |
There's not an "Official one" that I know of, but the tools usually follow the version on the runtime lib your trying to use, so https://www.nuget.org/packages/Microsoft.EntityFrameworkCore/3.0.0-preview5.19227.1 Gives you the NuGet page (and thusly the version) for preview 5, and if you scroll down you'll see the versions for the other previews too. Copying those versions should (In theory) work. |
@mzrks Use |
Cheers Brice, I knew you'd have the answer :-) |
Thank you, it really works. |
FInally, the fix worked for me was renaming the folder names that dotnet ef was creating. |
@prakash-manit I would strongly suggest to install the right version to avoid the issues as @shawty suggest. From my experience and what I am seeing in the post, the best solution for this problem is to check your highest net core version and install that EF version as @BrettBaggott suggest |
for Me it was the path 2.2.0 servicing , but servicing was missing so just renamed at 2 place and it worked for me , on .net core 2.2 |
@antonioortizpola the same here :) |
I have the same problem. Did you rename the folders? Not some configuration files? Is it safe? I see version of dotnet-ef.dll matches. |
Had the same problem (Windows machine):
First question: Why is this happening? Is it because |
@EmKayUltra I'm not in any way speaking on behalf of Microsoft or the Entity framework team here, but this is NO LONGER an issue. Let me explain. When I first opened this issue, I was unaware of how the versioning for the preview versions of dotnet core worked with regards to loadable tools. Since then, I've done my research and spoken to many members of various MS development teams who have confirmed that tool versions are always set to match dotnet core versions. This has nothing to do with MS separating out the tools, but it has everything to do with them enforcing matching versions so that you get the correct tool for the version of dotnet you are using. If for example, you install a supported version of dotnet core 2.2, then simply do If you then install dotnet core 3.0 without uninstalling anything else, your default working version of dotnet core will be set to version 3.0 At this point, dotnet-ef will cease to work, and the reason for this is because you at that point will not have a v3.0 compatible version of the tool installed. If however you then once again do The same is also true for any templates you have installed. I've actually created a small batch file with all my
statements in, and I run it every time I update my dotnet core SDK version, thus ensuring that I have the latest versions of anything I have added to the install. You will ONLY get problems installing these tools, in 2 specific scenarios:
In the case of (1) above, if you do a plain old "dotnet tool install --global dotnet-ef", and your on an sdk preview and/or unsupported build, you will also see problems relating to not finding the tool. The MS team (If you read above) have closed this issue way back in October, as there's nothing to answer here, there is no issue, no fault, no bug or anything. The only reason I know this keeps getting hits is because as the original author GitHub notifies me every time there is a change on it. So finally I ask only this: If after reading it all, you still believe that you've encountered a bug, then open a new issue in the issue tracker, and reference this thread. Adding your "i have a bug" post to this thread is NOT going to get you the answer or the assistance you seek, because it's now a closed issue. |
What worked for me was uninstalling dotnet ef and installing again |
this still seems to a problem in converting from 2.2 to 3.1.3 - i get preview 2.1 and the error |
A hack a day keeps the doctor away - thanks for posting this. |
I got the same type of error, but it was because I had set the wrong startup-project in my command... :facepalm |
Filing on behalf of @DamianEdwards
Describe what is not working as expected.
Steps to reproduce
With a .NET Core 3.0 SDK, run
dotnet tool install -g dotnet-ef
and rundotnet ef
The text was updated successfully, but these errors were encountered: