Description
After moving all my sources and packages to a new Dev Drive following these instructions, the dotnet-ef
tool would not work anymore.
dotnet-tools.json
{
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "7.0.5",
"commands": ["dotnet-ef"]
}
}
}
CLI
PS D:\repos\project> dotnet ef
Run "dotnet tool restore" to make the "dotnet-ef" command available.
PS D:\repos\project> dotnet tool restore
Tool 'dotnet-ef' (version '7.0.5') was restored. Available commands: dotnet-ef
Restore was successful.
PS D:\repos\project> dotnet ef
Run "dotnet tool restore" to make the "dotnet-ef" command available.
No matter how I would try to restore the tools, even if it reported success, the tool was still not available.
After banging my head against this for some time, I found out that if I deleted the cache in the %USERPROFILE%\.dotnet\toolResolverCache
folder followed by executing dotnet tool restore
, the dotnet ef
command would start working again.
Neither I nor GPT-4 could find any other mention of this problem somewhere. Perhaps if more people start moving to Dev Drive (20% less build time!) this step should be documented somewhere. Or if it's a bug, it would be nice if the dotnet tool restore
command was a bit more resilent to a moved repository.
Include provider and version information
EF Core version: 7.0.5
Operating system: Windows 11 insider dev channel