How to install multiple versions of .NET on macOS

1 min read

  1. Add the Microsoft package feed to your system
brew tap isen-ng/dotnet-sdk-versions
  1. Install the desired version of the .NET SDK
brew install --cask dotnet-sdk-6-0-400
brew install --cask dotnet-sdk-7-0-400
  1. Verify the installation
dotnet --list-sdks

This way you can use multiple versions of the .NET SDK in parallel.

In your .NET code you can specify the desired version in the global.json file:

{
"sdk": {
"version": "7.0.400"
}
}

Resources: