A cross-platform toolchain for developing, building, running, and publishing .NET applications.
I assume you mean dotnet when you say the .NET CLI commands. There is only one copy of dotnet on a machine (per bitness). The latest version wins. So irrelevant of whether your code is compiling for .NET Core, .NET Standard or .NET 6 it is going to use the same tool. That makes sense because the tool itself isn't doing anything that requires it to match your app's target framework. It's just the gateway to run tools. In your case you're ultimately compiling against 3.1 so it'll use the 3.1 tools. This is not really much different than you running cmd.exe to build code for various platforms. The CLI is just the host process used to orchestrate the actual commands to run.