Filing on behalf of @DamianEdwards
Describe what is not working as expected.
Error message: The application to execute does not exist
With a .NET Core 3.0 SDK, run dotnet tool install -g dotnet-ef
and run dotnet ef
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
Shawty
The workaround for .NET Core 3.0 SDK users is to run
dotnet tool install -g dotnet-ef --version 3.0.0-preview4.19216.3
@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 install
doesn't look at preview packages, and hence tries to load the 2.2 package, which is not intended to be loaded in this way. This means that:
We will discuss this in triage, but for now this feels like a won't fix
to me.
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
dotnet ef database update
i get
cannot find command 'dotnet ef
then i did run the command
dotnet tool uninstall --global dotnet-ef
then i tried with
dotnet ef database update
again then i got this error
The application to execute does not exist: 'C:\Users\MyUser\.dotnet\tools\.store\dotnet-ef\2.2.0-rtm-35687\dotnet-ef\2.2.0-rtm-35687\tools\netcoreapp2.2\any\dotnet-ef.dll'.
and when i have checked this path i found that it installs it as
C:\Users\MyUser\.dotnet\tools\.store\dotnet-ef\2.2.0\dotnet-ef\2.2.0\tools\netcoreapp2.2\any\dotnet-ef.dll
without-rtm-35687
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.
The workaround for .NET Core 3.0 SDK users is to run
dotnet tool install -g dotnet-ef --version 3.0.0-preview4.19216.3
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
dotnet tool uninstall --global dotnet-ef
followed by
dotnet tool install --global dotnet-ef --version 2.1.0
Then I could run
dotnet ef database update --context ApplicationDbContext
The workaround for .NET Core 3.0 SDK users is to run
dotnet tool install -g dotnet-ef --version 3.0.0-preview4.19216.3
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 --version 3.0.0-*
to get the latest.
Cheers Brice, I knew you'd have the answer :-)
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.
Thank you, it really works.
FInally, the fix worked for me was renaming the folder names that dotnet ef was creating.
The folder that dotnet ef has created: C:\Users\pratripathi.dotnet\tools.store\dotnet-ef\2.2.6\dotnet-ef\2.2.6\tools\netcoreapp2.2\any
The folder that dotnet ef was trying to access: C:\Users\
Hope above fix helps to the folks who don't want to use preview releases
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 :)
and when i have checked this path i found that it installs it as
C:\Users\MyUser\.dotnet\tools\.store\dotnet-ef\2.2.0\dotnet-ef\2.2.0\tools\netcoreapp2.2\any\dotnet-ef.dll
without-rtm-35687
so i had to rename the folders manually to match and it worked fine
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):
dotnet ef
"Could not execute because the specified command or file was not found."dotnet tool uninstall --global dotnet-ef
did not do anything because dotnet-ef was not founddotnet tool install --global dotnet-ef --version 2.*
installed 2.2.6dotnet ef
"The application to execute does not exist: 'C:\Users\emkayultra.dotnet\tools.store\dotnet-ef\2.2.6-servicing-10079\dotnet-ef\2.2.6-servicing-10079\tools\netcoreapp2.2\any\dotnet-ef.dll'.dotnet ef
now works.First question: Why is this happening? Is it because dotnet ef
is no longer part of the default SDK as of 3.0? Shouldn't they live in isolation from each other?
Second question: How is this acceptable? Seems like a ludicrous solution to the problem.
Related? https://github.com/aspnet/EntityFrameworkCore/issues/14016 @bricelam
@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 "dotnet tool install --global dotnet-ef"
, the version of dotnet-ef that will be installed on your machine will be version 2.2
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 "dotnet tool install --global dotnet-ef"
you'll find that you will regain use of the ef tool, only this time it will be version 3.0 and not the 2.2 version you have been using.
The same is also true for any templates you have installed. I've actually created a small batch file with all my
"dotnet tool install ..."
and
"dotnet new install ..."
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:
Those folks who end up here because they are having trouble making the ef tool work, please read the whole thread before you post anything to it.
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
install did not work until i did uninstall first
I had the same issue with .NET Core 2.2 after i have installed .NET Core 3.0 Preview
when i try to execute
dotnet ef database update
i get
cannot find command 'dotnet ef
then i did run the command
dotnet tool uninstall --global dotnet-ef
then i tried with
dotnet ef database update
again then i got this error
The application to execute does not exist: 'C:\Users\MyUser\.dotnet\tools\.store\dotnet-ef\2.2.0-rtm-35687\dotnet-ef\2.2.0-rtm-35687\tools\netcoreapp2.2\any\dotnet-ef.dll'.
and when i have checked this path i found that it installs it as
C:\Users\MyUser\.dotnet\tools\.store\dotnet-ef\2.2.0\dotnet-ef\2.2.0\tools\netcoreapp2.2\any\dotnet-ef.dll
without-rtm-35687
so i had to rename the folders manually to match and it worked fine
A hack a day keeps the doctor away - thanks for posting this.
Most helpful comment
The workaround for .NET Core 3.0 SDK users is to run