question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet-ef not available after successful restore

See original GitHub issue

We have an interesting issue on one of our build agents regarding dotnet ef cli tool. The error only occurs on one of our agents, however I cannot figure out what’s off.

Running dotnet tool restore in my project directory outputs

Tool 'dotnet-ef' (version '3.1.4') was restored. Available commands: dotnet-ef

However when trying to run dotnet-ef I get an error:

$ dotnet ef
Run "dotnet tool restore" to make the "dotnet-ef" command available.
$ dotnet dotnet-ef
Run "dotnet tool restore" to make the "dotnet-ef" command available.
$ dotnet ef --version
Run "dotnet tool restore" to make the "dotnet-ef" command available.
$ dotnet dotnet-ef --version
Run "dotnet tool restore" to make the "dotnet-ef" command available.
$ dotnet tool run dotnet-ef --version
Run "dotnet tool restore" to make the "dotnet-ef" command available.
Usage: dotnet tool run [options] <COMMAND_NAME> [[--] <additional arguments>...]]

Arguments:
  <COMMAND_NAME>   The command name of the tool to run.

Options:
  -h, --help   Show command line help.
Additional Arguments:
  Arguments passed to the application that is being run.

Further technical details

dotnet-ef version: 3.1.4 dotnet --version: 3.1.300 Target framework: .NET Core 3.1.4 Operating system: Ubuntu 18.04.1 LTS

I’ll attach a verbose output from dotnet tool restore separately.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
dug9000commented, Feb 10, 2021

We are seeing this same issue on Windows 10 pipeline builds as well. Currently we are doing the following to workaround it:

    if (HasEnvironmentVariable("USERPROFILE") && DirectoryExists(EnvironmentVariable("USERPROFILE") + "/.dotnet/toolResolverCache"))
    {
        DeleteDirectory(EnvironmentVariable("USERPROFILE") + "/.dotnet/toolResolverCache", new DeleteDirectorySettings { Recursive = true, Force = true});
        DotNetCoreTool("tool restore");
    }

But this kind of defeats the purpose of having a toolResolverCache. If the toolResolverCache can’t be done reliably maybe this caching should just be removed from dotnet.

1reaction
ajcvickerscommented, May 29, 2020

Moving this to the SDK repo since it doesn’t seem specific to EF.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Run dotnet tool restore to make the dotnet-ef command ...
I found 2 ways. try to run visual studio as administrator. if (1.) does not work, in the project enter dotnet new tool-manifest...
Read more >
dotnet restore command - .NET CLI
Learn how to restore dependencies and project-specific tools with the dotnet restore command.
Read more >
How to Solve the Command or File Was Not Found EF ...
In this article, we are going to learn how to solve the Command or File Was Not Found EF Core migration error.
Read more >
C# 11 and .NET 7 – Modern Cross-Platform Development ...
NET Core 7, Blazor, and EF Core 7, 7th Edition Mark J. Price ... appear in search results and will be available for...
Read more >
E.F. Hutton mail and wire fraud case: hearings before the ...
We were requested at that time to use our 1980 profit on the E.F. Hutton accounts to ... Since this has not happened...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found