Establish Build Tool Locality with .Net Core 3.x

One goal of .Net Core 3 is to better separate “The Core Framework” from “Framework Tooling”. Furthermore, a new feature that allows installing tools local to a project was introduced which is very helpful in keeping projects logically independent even with the tools used within the project.

One popular example is the Entity Framework Core CLI Tools package, which now no longer ships with the .Net Core 3.0 SDK and needs to be installed separately. Here is how I got configured in light of the above information:

1-Create new local tool manifest file (works similar to an NPM package.json). This will store information about what tools/versions are setup for this project

2- Install the tool locally using the Package Management Console

In looking at the manifest file that got created, we can see that we have captured information about the EF Core Client Tool local to the project. Locality makes portability a breeze as we now have taken an additional step to decouple our project from the environment where its being developed. Recreating that environment can be done by simply issuing a dotnet tool restore command.

{
  "version": 1,
  "isRoot": true,
  "tools": {
    "dotnet-ef": {
      "version": "3.1.1",
      "commands": [
        "dotnet-ef"
      ]
    }
  }
}

Nice References:

https://docs.microsoft.com/en-us/ef/core/miscellaneous/cli/dotnet

https://docs.microsoft.com/en-us/ef/core/miscellaneous/cli/powershell