I got the same problem. I copied the app folder to another directory and then ran the Entity Framework Core installation in the new folder. So this means you will now have to run the project from this new folder and just leave the old folder.
'EntityFramework.Core.Tools' nuget package installation error: "The process cannot access the file ef.exe because it is being used by another process"

While installing the package Microsoft.EntityFrameworkCore.Tools for using EF in my project using Nuget, I'm persistently running into the below error. Notice I didn't get any error while installing other related packages used for EF core.
- Microsoft.EntityFrameworkCore
- Microsoft.EntityFrameworkCore.Relational
- Microsoft.EntityFrameworkCore.SqlServer
Here is the location of the file ef.exe
Basically the intention behind installing this package is to use EF command-line tools. I'm currently on Windows 10 and the .NET SDK installed on my machine is 3.1. I had previously 2 SDK's installed on my system(3.1 & 5.0). As per microsoft's documentaion, "The .NET CLI must choose an SDK version for every dotnet command. It uses the latest SDK installed on the machine by default." Therefore I went ahead and uninstalled .NET 5.0 SDK.
However, after doing so, I'm even unable to open/load any .NET framework based projects and my VS 2019 installer says that .NET 5 SDK is a required component of VS 2019 to load projects. The real question is "Is .NET 5 SDK causing this i.e. can having multiple SDKs on a single machine cause this kind of issues?"
Here are some of the solutions that I tried:
- Deleting the package folder from '.nuget/packages/microsoft.entityframeworkcore.tools' & thereby the executable i.e. 'ef.exe' and reinstalling the same.
- Installing the same package using dotnet cli.
- Running Visual Studio 2019 as admin.
- Deleted the folder "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions"
I have also tried some of the steps mentioned here on github: https://github.com/NuGet/Home/issues/1138.
Any kind of help would be really appreciated.