Install specific Mono version

Had some time testing and indeed it seems simply downloading a pkg from mono’s website (http://www.mono-project.com) or more specifically from their downloads site (https://download.mono-project.com/archive/) and installing it with the macOS built in pkg installer (installer) works like a charm, I did not have to change anything else.

Script to install the previous Visual Studio for Mac Stable’s Mono version (5.2.0.224) - can be the very first step in the workflow:

#!/bin/bash
set -ex

# create a temp dir and cd into it
mkdir -p /tmp/mono-install
cd /tmp/mono-install

# debug: mono version before the install
mono --version

# download mono mac installer (pkg)
wget -q https://download.mono-project.com/archive/5.2.0/macos-10-universal/MonoFramework-MDK-5.2.0.224.macos10.xamarin.universal.pkg -O ./mono-installer.pkg

# install it
sudo installer -pkg ./mono-installer.pkg -target /

# debug: mono version after install, just to confirm it did overwrite the original version
mono --version

# just for fun print this symlink too, which should point to the version we just installed
ls -alh /Library/Frameworks/Mono.framework/Versions/Current
1 Like