Homebrew dotnet

Install the .NET SDK side-by-side on macOS using the Homebrew package manager.

How to Use

If you are currently using the .NET formula from the official Homebrew Cask, you should uninstall it first. For example:

brew uninstall --zap dotnet-sdk

First, tap the repository:

brew tap junian/homebrew-dotnet

Installation

Install the desired .NET version:

brew install dotnet-sdk@<version>

For example, to install .NET SDK 10.0:

brew install dotnet-sdk@10.0

Uninstallation

Uninstall the desired .NET version:

brew uninstall dotnet-sdk@<version>

For example:

brew uninstall dotnet-sdk@9.0

.NET SDK Versions

Version Formula
⚠️ .NET 11 (Preview) dotnet-sdk@11.0
⭐️ .NET 10 (LTS) dotnet-sdk@10.0
⭐️ .NET 9 dotnet-sdk@9.0
⭐️ .NET 8 (LTS) dotnet-sdk@8.0
.NET 7 dotnet-sdk@7.0
.NET 6 (LTS) dotnet-sdk@6.0
.NET 5 dotnet-sdk@5.0
  • ⭐️ Active: During the active support period, .NET releases are updated to improve functional capabilities and mitigate security vulnerabilities.
  • ⚠️ Preview: Preview releases provide early access to features that are currently under development. These releases are generally not supported for production use.
  • Other releases have reached end of life, meaning they’re no longer supported. It’s recommended to moving to a supported release.

Where Is .NET 4 / .NET Core 4?

There is no .NET 4 or .NET Core 4. Version 4.x is reserved for .NET Framework, which only runs on Windows.

Microsoft transitioned from .NET Core to simply .NET starting with version 5.

The closest alternative to .NET Framework 4.x on macOS is Mono MDK.

.NET Core SDK Versions

Version Formula
.NET Core 3.1 (LTS) dotnet-sdk@3.1
.NET Core 3.0 dotnet-sdk@3.0
.NET Core 2.2 dotnet-sdk@2.2
.NET Core 2.1 (LTS) dotnet-sdk@2.1
.NET Core 2.0 dotnet-sdk@2.0
.NET Core 1.1 dotnet-sdk@1.1
.NET Core 1.0 dotnet-sdk@1.0

Special Note for .NET Core 3.1 and .NET 5

On Apple Silicon Macs, if you install .NET Core 3.1 or .NET 5, the dotnet binary is located at:

/usr/local/share/dotnet/x64/dotnet

You can create an alias:

alias dotnet-x64=/usr/local/share/dotnet/x64/dotnet

Then use it, for example:

% dotnet-x64 --list-sdks
3.1.426 [/usr/local/share/dotnet/x64/sdk]
5.0.408 [/usr/local/share/dotnet/x64/sdk]

Mono MDK Version

Before Microsoft created a cross-platform .NET, there was a community-developed .NET-compatible implementation called Mono.

Version Formula
Mono MDK 6.12 mono-mdk@6.12

Xamarin Versions

These packages depend on Mono MDK:

Version Formula
Xamarin.Mac xamarin-mac@9.3
Xamarin.iOS xamarin-ios@16.4
Xamarin.Android xamarin-android@13.2

Visual Studio for Mac

This application also depends on Mono MDK:

Version Formula
Visual Studio 2022 for Mac visual-studio@2022

Brief History of .NET

If you’re confused about .NET versions and naming, here’s a quick history:

  1. 2002: .NET Framework (Windows-only, closed source)
  2. 2004: Mono (community-driven, cross-platform, open source)
  3. 2011: Xamarin (Mono for Android, MonoTouch for iOS)
  4. 2016: Microsoft acquires Xamarin and releases .NET Core (modern, cross-platform, open source)
  5. 2020: .NET 5 unifies everything into one platform, simply called .NET (cross-platform, open source)

Cask Updater

A simple script is provided to automatically update the supported .NET casks.

Install .NET 10, then run:

./update_casks.cs

If updates are available, the script will modify the cask files. Commit and push the changes afterward.

Most of the time, you don’t need to run it manually, as updates are checked every 4 hours via GitHub Workflow.

This repo is on autopilot, meaning every new minor version update will be handled by GitHub Actions. I’ll just update it occassionally such as when a major version is released or the old versions no longer supported.

LICENSE

MIT