- Download
- Mono for macOS is available as a Mac Package (.pkg)
- 1 Add the Mono repository to your system
- Ubuntu 20.04 (amd64, armhf, arm64, ppc64el)
- Ubuntu 18.04 (i386, amd64, armhf, arm64, ppc64el)
- Ubuntu 16.04 (i386, amd64, armhf, arm64, ppc64el)
- 2 Install Mono
- 3 Verify Installation
- Notes
- 1 Add the Mono repository to your system
- Debian 10 (i386, amd64, armhf, arm64, armel, ppc64el)
- Debian 9 (i386, amd64, armhf, arm64, armel, ppc64el)
- 2 Install Mono
- 3 Verify Installation
- Notes
- 1 Add the Mono repository to your system
- Raspbian 10 (armhf)
- Raspbian 9 (armhf)
- 2 Install Mono
- 3 Verify Installation
- Notes
- 1 Add the Mono repository to your system
- CentOS/RHEL 8 (x86_64)
- CentOS/RHEL 7 (x86_64)
- CentOS/RHEL 6 (x86_64, i686)
- 2 Install Mono
- 3 Verify Installation
- 1 Add the Mono repository to your system
- Fedora 29 (x86_64)
- Fedora 28 (x86_64)
- 2 Install Mono
- 3 Verify Installation
- Mono for Windows is available as a Windows Installer file
- Mono is available on Docker Hub
- Available tags
- Release Notes
- MonoDevelop IDE
- Older releases
- Mono Support
- Supported Build Runners
- Mono Platform Detection
- Agent Properties
- Windows Specifics
- macOS Specifics
- Custom Linux/Unix Specifics
- Compiling Mono on Windows
- Install prerequisites
- Cloning Mono from GitHub repository
- Pre-configured build instructions
- Detailed build instructions
- Enable BTLS as cryptographic backend for Windows builds
- Enable LLVM for Windows builds
- Use monolite instead of pre-installed Mono distribution
- Build Mono using Visual Studio
- Build 64-bit Mono using Visual Studio
- Build 32-bit Mono using Visual Studio
- Build Mono from Visual Studio command line
- Visual Studio MSBuild build properties
- Configure make to use Visual Studio build Mono runtime
- Build Mono mingw runtime, BCL and Tests
- Known Issue: “failed to create symbolic link”
- Run all tests
Download
The latest Stable Mono release is: 6.12.0 Stable (6.12.0.122)
Please choose your operating system to view the available packages. Source code is available on GitHub (viewing only) or as a Tarball.
macOS Linux Windows Docker
Mono for macOS is available as a Mac Package (.pkg)
Please refer to the installation guide for more information about how to install and configure your Mono environment.
Supported on macOS 10.9 and later. Check the uninstall instructions if you want to remove Mono from your Mac.
* We recommend this package if you’re using Visual Studio for Mac since the stability of Visual Studio for Mac is only guaranteed with the Visual Studio channel releases.
1 Add the Mono repository to your system
The package repository hosts the packages you need, add it with the following commands.
Note: the packages should work on newer Ubuntu versions too but we only test the ones listed below.
Ubuntu 20.04 (amd64, armhf, arm64, ppc64el)
Ubuntu 18.04 (i386, amd64, armhf, arm64, ppc64el)
Ubuntu 16.04 (i386, amd64, armhf, arm64, ppc64el)
2 Install Mono
The package mono-devel should be installed to compile code.
The package mono-complete should be installed to install everything — this should cover most cases of «assembly not found» errors.
The package mono-dbg should be installed to get debugging symbols for framework libraries — allowing you to get line numbers in stack traces.
The package referenceassemblies-pcl should be installed for PCL compilation support — this will resolve most cases of «Framework not installed: .NETPortable» errors during software compilation.
The package ca-certificates-mono should be installed to get SSL certificates for HTTPS connections. Install this package if you run into trouble making HTTPS connections.
The package mono-xsp4 should be installed for running ASP.NET applications.
3 Verify Installation
After the installation completed successfully, it’s a good idea to run through the basic hello world examples on this page to verify Mono is working correctly.
Notes
Mono on Linux before 3.12 by default didn’t trust any SSL certificates so you got errors when accessing HTTPS resources. This is not required anymore as 3.12 and later include a new tool that runs on package installation and syncs Mono’s certificate store with the system certificate store (on older versions you had to import Mozilla’s list of trusted certificates by running mozroots —import —sync ). Some systems are configured in a way so that the necessary package isn’t pulled in when Mono is installed, in those cases make sure the ca-certificates-mono package is installed.
1 Add the Mono repository to your system
The package repository hosts the packages you need, add it with the following commands.
Note: the packages should work on newer Debian versions too but we only test the ones listed below.
Debian 10 (i386, amd64, armhf, arm64, armel, ppc64el)
Debian 9 (i386, amd64, armhf, arm64, armel, ppc64el)
2 Install Mono
The package mono-devel should be installed to compile code.
The package mono-complete should be installed to install everything — this should cover most cases of «assembly not found» errors.
The package mono-dbg should be installed to get debugging symbols for framework libraries — allowing you to get line numbers in stack traces.
The package referenceassemblies-pcl should be installed for PCL compilation support — this will resolve most cases of «Framework not installed: .NETPortable» errors during software compilation.
The package ca-certificates-mono should be installed to get SSL certificates for HTTPS connections. Install this package if you run into trouble making HTTPS connections.
The package mono-xsp4 should be installed for running ASP.NET applications.
3 Verify Installation
After the installation completed successfully, it’s a good idea to run through the basic hello world examples on this page to verify Mono is working correctly.
Notes
Mono on Linux before 3.12 by default didn’t trust any SSL certificates so you got errors when accessing HTTPS resources. This is not required anymore as 3.12 and later include a new tool that runs on package installation and syncs Mono’s certificate store with the system certificate store (on older versions you had to import Mozilla’s list of trusted certificates by running mozroots —import —sync ). Some systems are configured in a way so that the necessary package isn’t pulled in when Mono is installed, in those cases make sure the ca-certificates-mono package is installed.
1 Add the Mono repository to your system
The package repository hosts the packages you need, add it with the following commands.
Note: the packages should work on newer Raspbian versions too but we only test the ones listed below.
Raspbian 10 (armhf)
Raspbian 9 (armhf)
2 Install Mono
The package mono-devel should be installed to compile code.
The package mono-complete should be installed to install everything — this should cover most cases of «assembly not found» errors.
The package mono-dbg should be installed to get debugging symbols for framework libraries — allowing you to get line numbers in stack traces.
The package referenceassemblies-pcl should be installed for PCL compilation support — this will resolve most cases of «Framework not installed: .NETPortable» errors during software compilation.
The package ca-certificates-mono should be installed to get SSL certificates for HTTPS connections. Install this package if you run into trouble making HTTPS connections.
The package mono-xsp4 should be installed for running ASP.NET applications.
3 Verify Installation
After the installation completed successfully, it’s a good idea to run through the basic hello world examples on this page to verify Mono is working correctly.
Notes
Mono on Linux before 3.12 by default didn’t trust any SSL certificates so you got errors when accessing HTTPS resources. This is not required anymore as 3.12 and later include a new tool that runs on package installation and syncs Mono’s certificate store with the system certificate store (on older versions you had to import Mozilla’s list of trusted certificates by running mozroots —import —sync ). Some systems are configured in a way so that the necessary package isn’t pulled in when Mono is installed, in those cases make sure the ca-certificates-mono package is installed.
1 Add the Mono repository to your system
The package repository hosts the packages you need, add it with the following commands in a root shell.
Note: the packages should work on newer CentOS/RHEL versions too but we only test the ones listed below.
CentOS/RHEL 8 (x86_64)
CentOS/RHEL 7 (x86_64)
CentOS/RHEL 6 (x86_64, i686)
2 Install Mono
The package mono-devel should be installed to compile code.
The package mono-complete should be installed to install everything — this should cover most cases of «assembly not found» errors.
The package referenceassemblies-pcl should be installed for PCL compilation support — this will resolve most cases of «Framework not installed: .NETPortable» errors during software compilation.
The package xsp should be installed for running ASP.NET applications.
3 Verify Installation
After the installation completed successfully, it’s a good idea to run through the basic hello world examples on this page to verify Mono is working correctly.
1 Add the Mono repository to your system
The package repository hosts the packages you need, add it with the following commands in a root shell.
Note: we’re using the CentOS/RHEL repositories on Fedora.
Fedora 29 (x86_64)
Fedora 28 (x86_64)
2 Install Mono
The package mono-devel should be installed to compile code.
The package mono-complete should be installed to install everything — this should cover most cases of «assembly not found» errors.
The package referenceassemblies-pcl should be installed for PCL compilation support — this will resolve most cases of «Framework not installed: .NETPortable» errors during software compilation.
The package xsp should be installed for running ASP.NET applications.
3 Verify Installation
After the installation completed successfully, it’s a good idea to run through the basic hello world examples on this page to verify Mono is working correctly.
Mono for Windows is available as a Windows Installer file
Please refer to the installation guide for more information about how to install and configure your Mono environment.
Supported on Windows 7, 8, 10 or later.
GTK# for .NET
Installer for running Gtk#-based applications on Microsoft .NET:
Mono is available on Docker Hub
The simplest way to get started is:
This will download the latest Mono Docker image, create a container and put you into an interactive shell.
Available tags
There are several tags for selecting the desired Mono version:
- latest — Always points to the latest release
- X.X.X.X — points to a specific version, e.g. 5.8.0.108
- X.X.X — points to the latest version in the X.X.X series, e.g. 5.8.0
- X.X — points to the latest version in the X.X series, e.g. 5.8
- X — points to the latest version in the X series, e.g. 5
The latest version, one minor version before that and the last version before a major version bump are periodically rebuilt by Docker Hub to pull in updates from the base Debian image.
All other version tags are still available, but won’t get those updates so you need to keep your images up to date by running apt update yourself. We encourage you to move to latest Mono releases as soon as they’re available.
Starting with Mono 5.2 we provide a slim variant (e.g. latest-slim ) which only contains the bare minimum to run a simple console app. You can use this as a base and add just what you need.
Release Notes
Check out the release notes of all Mono versions here.
MonoDevelop IDE
Please visit the MonoDevelop website for more details about our cross-platform IDE.
Older releases
To access older Mono releases for macOS and Windows, check the archive on the download server. For Linux, please check the «Accessing older releases» section in the installation guide.
Mono Support
Mono framework is an alternative framework for running .NET applications on both Windows and Unix-based platforms.
For more information refer to the Mono official site.
Supported Build Runners
TeamCity supports running .NET builds using NAnt and MSBuild runners under Mono framework as well as under .NET Frameworks. (MSBuild as xbuild in Mono).
NuGet runners support Linux and macOS when Mono is installed on the agent. Note that only NuGet CLI 3.2+ on Mono 4.4.2+ is supported.
Tests reporting tasks are also supported under Mono.
Mono Platform Detection
When a build agent starts, it detects a Mono installation automatically.
On each platform, Mono detection is compatible with NAnt one. See NAnt.exe.config for frameworks detection on NAnt.
Agent Properties
When Mono is detected automatically on the agent side, the following properties are set:
Mono — path to the mono executable (Mono JIT)
MonoVersion — Mono version
MonoX.Z — set to MONO_ROOT/lib/mono/X.Z if exists
MonoX.Z_x64 — set to MONO_ROOT/lib/mono/X.Z if exists and Mono architecture is x64
MonoX.Z_x86 — set to MONO_ROOT/lib/mono/X.Z if exists and Mono architecture is x86
If the Mono installation cannot be detected automatically (for example, you have installed Mono framework into a custom directory), you can make these properties available to build runners by setting them manually in the agent configuration file.
Windows Specifics
Automatic detection of Mono framework under Windows has the following specifics:
The Mono version is read from HKLM\SOFTWARE\Novell\Mono\DefaultCLR .
The Frameworks paths are extracted from HKLM\SOFTWARE\Novell\Mono\%MonoVersion% .
The platform architecture is detected by analyzing mono.exe .
macOS Specifics
The framework is detected automatically from /Library/Frameworks/Mono.framework/Versions .
The highest version is selected.
The frameworks path are extracted from /Library/Frameworks/Mono.framework/Versions/%MonoVersion%/lib/mono .
The platform architecture is fixed to x86 as Mono official builds support only X86.
Custom Linux/Unix Specifics
Automatic detection of Mono framework under Unix has the following specifics:
Mono version is read from pkg-config —modversion mono .
The frameworks paths are extracted from pkg-config —variable=prefix mono and pkg-config —variable=libdir mono .
The platform architecture is detected by analyzing the PREFIX/bin/mono executable. You can force Mono to be detected from a custom location by adding the PREFIX/bin directory to the beginning of the PATH and updating PKG_CONFIG_PATH (described in pkg-config(1) ) with PREFIX/lib/pkgconfig.
Compiling Mono on Windows
To build Mono on Windows, a Cygwin setup is required. You’ll also need Visual Studio 2015 or Visual Studio 2015 Build Tools for command line builds. Visual Studio 2017 is also supported.
NOTE, below instructions apply to Cygwin. If WSL (Windows Subsystem for Linux) is used instead of Cygwin, corresponding packages needs to be installed into WSL environment.
It is possible to build Mono runtime and BCL using Visual Studio without any prerequisites on Cygwin or WSL environment, see build Mono without Cygwin or WSL for details.
NOTE, for full build and execution of tests, a Cygwin environment is still needed as outlined below.
Install prerequisites
- Enable Developer Mode in the Windows 10 Settings app (Update & Security -> For developers tab)
- Download and install 64 bit Cygwin from www.cygwin.com.
- Install Visual Studio 2015 or later — Community Edition works fine.
- Download and install Mono for Windows or use monolite build step as described below.
- Run the following command in cmd.exe to install Cygwin and required packages:
Make sure that the following GIT setting is used to avoid issues with line endings:
git config —global core.autocrlf input
Cloning Mono from GitHub repository
First step is to clone Mono repository directly from GitHub, PREFIX is you Mono installation location (see below for details):
Pre-configured build instructions
Pre-configured build instructions, building a default Visual Studio Mono runtime, mingw Mono runtime, Mono BCL and install into PREFIX . For further detailed build configurations and instructions, see next section. Run one of the following set of commands from a Cygwin command prompt after all steps in section above have been completed.
64-bit Mono runtime using SGEN GC and default BCL profile (net_4_x):
32-bit Mono runtime using SGEN GC and default BCL profile (net_4_x):
Detailed build instructions
If one of the pre-configured set of build instructions above doesn’t match configuration needs, this section outline detailed step by step build instructions.
Build will use configured PREFIX where an existing Mono distribution exists that will be used and later replaced by build. NOTE, to keep existing Mono distribution untouched, setup a different PREFIX where the new build will be installed.
It is possible to only configure PATH to point to an existing Mono distribution without specify PREFIX but then make install will install build into default location.
Another option is to build without an existing pre-installed Mono distribution, see section related to monolite for more details or the section describing how to use a Visual Studio build Mono runtime in MONO_EXECUTABLE environment variable as part of build.
The following configure steps shows different supported Mono build configurations.
64-bit Mono runtime using SGEN GC and default BCL profile (net_4_x). The Boehm GC is not supported on 64-bit Windows build:
32-bit Mono runtime using SGEN GC and default BCL profile (net_4_x):
32-bit Mono runtime using Boehm GC and default BCL profile (net_4_x):
NOTE, 32-bit Mono runtime supports both SGEN and Boehm GC. Boehm GC is still available for legacy reasons but not supported on 64-bit Windows builds. It is recommended to use SGEN GC for both 32 and 64-bit Windows builds.
Enable BTLS as cryptographic backend for Windows builds
Mono on Windows supports BTLS library as an alternative cryptographic backend for SSL/TLS. It is not the default alternative and must be enabled to build and be used by Mono runtime. To enable BTLS, pass —enable-btls to the autogen.sh step above.
BTLS build will add a couple of additional prerequisites for Visual Studio builds. The easiest way to get additional needed packages is to install and use Chocolatey package manager. See https://chocolatey.org/install for instructions on how to install Chocolatey package manager into the build system.
Once Chocolatey has been installed, add the following packages to the build system:
Optional, in order to build BTLS with assembler optimization support, additional packages needs to be installed. It is still possible to build without these packages using Visual Studio as cmake build generator, but that configuration won’t be able to build assembler optimized cryptographic functions.
Make sure they are all visible to the build environment used by Visual Studio (restart any command prompts or Visual Studio IDE’s used in the build).
Enable LLVM for Windows builds
Mono on Windows supports LLVM in several different build combinations. When doing Windows cross compiler builds, host == Win32 but target != Win32, standard LLVM build instructions can be used.
For regular Windows builds, host == Win32, target == Win32 (described in this page), only x64 Visual Studio build supports LLVM. To enable LLVM, pass —enable-llvm to the autogen.sh step above.
Windows build supports most of the LLVM configuration flags, except —enable-loadedllvm . If configured with —with-llvm , Visual Studio build will use pre-build LLVM version pointed to by llvm-config.exe instead of building internal LLVM version as part of Visual Studio build.
NOTE, since only x64 Visual Studio build supports LLVM for regular Windows builds, a warning will be generated in the autogen.sh output indicating that LLVM will be disabled for mingw builds. Similar warning will be generated when building an unsupported build configuration from within Visual Studio (using the Win32 build configurations).
There is also a couple of MSBuild properties directly controlling the use of LLVM from Visual Studio builds (in case autogen.sh is not used or needs to be overridden).
When set to true, enable Visual Studio LLVM build. Could be explicitly passed to MSBuild or set in mono.props in order to force LLVM build.
When set to a path pointing to a pre-build version of llvm-config.exe , specified LLVM build will be used instead of doing local internal LLVM build as part of regular Visual Studio Mono runtime build. Could be explicitly passed to MSBuild or set in mono.props in order to force LLVM build.
Additional prerequisites only applies when building LLVM as part of Visual Studio Mono runtime build. If using —with-llvm configuration option or MONO_EXTERNAL_LLVM_CONFIG MSBuild property, no additional prerequisites are needed.
LLVM build will add a couple of additional prerequisites for Visual Studio builds. The easiest way to get additional needed packages is to install and use Chocolatey package manager. See https://chocolatey.org/install for instructions on how to install Chocolatey package manager into the build system.
Once Chocolatey has been installed, add the following packages to the build system:
Optional, by default LLVM build will use Visual Studio as cmake build generator. Build also support ninja as cmake build generator. In order to use ninja, install the following packages to the build system:
Make sure they are all visible to the build environment used by Visual Studio (restart any command prompts or Visual Studio IDE’s used in the build).
Use monolite instead of pre-installed Mono distribution
If no Mono distribution is available, you can build using monolite . Just run the command below before running make :
Build Mono using Visual Studio
The native runtime libraries can be built using Visual Studio and msbuild. However, the .NET libraries and tests must currently be built in Cygwin using make . The steps below describe how to build the runtime libraries in Visual Studio and use the Visual Studio built Mono executable when building the class libraries and tests as well as running the test suites in Cygwin.
Build 64-bit Mono using Visual Studio
Open the Mono solution msvc\mono.sln in Visual Studio IDE. Rebuild the solution using Release and x64 platform configurations. For command line build, see below.
Build 32-bit Mono using Visual Studio
Open the Mono solution msvc\mono.sln in Visual Studio IDE. Rebuild the solution using Release and Win32 platform configurations. For command line build, see below.
Build Mono from Visual Studio command line
Instead of building from within Visual Studio IDE you can run msbuild.exe directly from the command line. It is recommended to run the build from a Visual Studio Developer Command Prompt to get a correctly setup build environment.
For Visual Studio 2015: Run «%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat» from command prompt used in build or launch new command prompt using ´Developer Command Prompt for VS2015´ from start menu (if installed).
For Visual Studio 2017: Run «%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat» from the command prompt used in build or launch new command prompt using ´Developer Command Prompt for VS2017´ from start menu (if installed).
NOTE, paths to installed Visual Studio files could be different depending on install location and Visual Studio edition.
Example of a Visual Studio 2015 32-bit Mono runtime release build using SGEN GC:
Example of a Visual Studio 2015 64-bit Mono runtime release build using SGEN GC:
Example of a Visual Studio 2017 32-bit Mono runtime release build using SGEN GC:
Example of a Visual Studio 2017 64-bit Mono runtime release build using sgen GC:
There is also a build script that can be used to run msbuild.exe from a Visual Studio build environment, msvc\run-msbuild.bat . The script selects Visual Studio version toolchain based on VisualStudioVersion environment variable.
For Visual Studio 2015 64-bit Mono Runtime build:
For Visual Studio 2017 64-bit Mono Runtime build:
NOTE, while it is possible to run msbuild.exe from Cygwin environment it is not recommended since the build might pick up build tools and dependencies from Cygwin instead of Windows environment. There is however a build script msvc/run-msbuild.sh that can be called from Cygwin that will try to setup original Windows environment before running msbuild.exe .
Visual Studio MSBuild build properties
Building Mono runtime using Visual Studio offers a number of additional options compared to regular autogen.sh configuration steps. These properties can be explicitly passed to MBuild or set in mono.props property file, read by Mono Visual Studio build.
It is also possible to change property values within Visual Studio IDE through “Property Manager”, “View” -> “Other Windows” -> “Property Manager”, open Mono property sheet under Mono project (any configuration will do), and select “Common Properties” -> “User Macros”. When a value has been changed, select OK and all Visual Studio build configurations should be updated accordingly. If property values are changed directly in mono.props , while solution is loaded in Visual Studio, changes will not take place until after solution has been reloaded. If property values are change using IDE’s “Property Manager” dialog, changes applies directly to loaded solution.
Build tree location. Change to enable out of source tree builds, example c:\mono-build\ . Default value is .\build\ meaning build will end up in mono-root\msvc\build
GC used in build, sgen or boehm. NOTE, boehm is only supported on 32-bit build configurations. Default is sgen for all build configuration.
Link Mono binaries using static c-runtime. When false, all binaries and libraries will link using dynamic c-runtime. Default value is false.
Link Mono binaries using static libmono. When false, Mono binaries will link using dynamic libmono. Default value is false.
Mono runtime will link and include LLVM. If MONO_EXTERNAL_LLVM_CONFIG is not set, this will also build Mono LLVM repository as part of regular Mono runtime build. When false, Mono runtime will not link and include llvm libraries. Default value is false.
NOTE, this options can also be set through standard configuration, using —enable-llvm .
Use an external pre-build LLVM library instead of internal build. NOTE, this requires MONO_ENABLE_LLVM to be set or won’t have effect. Default value is empty.
NOTE, this options can also be set through standard configuration, using —with-llvm=full-path-to-llvm-config.exe .
Mono runtime will link and include BTLS. Setting this value to true will also build Mono BTLS repository as part of regular Mono runtime build. When false, Mono runtime will not link and include BTLS. Default value is false.
NOTE, since BTLS support is part of BCL build, just setting this when doing Mono runtime build will not include needed BTLS support in BCL build. It is recommended to use —enable-btls as part of configuration step since that will make sure BTLS support is included in both BCL as well as Mono runtime build.
Configure make to use Visual Studio build Mono runtime
For make to use Visual Studio build Mono runtime when building BCL and test, set MONO_EXECUTABLE environment variable to Visual Studio build Mono runtime. Switch to the Cygwin shell previously used and run:
NOTE, above path will change depending on source location, build location, 32/64-bit build configuration and used GC. The example above uses the default build location for a 64-bit release build Mono runtime configured to use SGEN GC.
Build Mono mingw runtime, BCL and Tests
Switch to the Cygwin shell previously used and run:
NOTE, the mingw build Mono runtime will still be built even if a Visual Studio build Mono runtime has been build and configured. The mingw runtime will however not be used as part of the BCL or test builds since MONO_EXECUTABLE has been configured.
Known Issue: “failed to create symbolic link”
If you run make V=1 and see this after a successful BCL build:
you need to enable Developer Mode in the Windows 10 Settings app (Update & Security -> For developers tab) which will allow your user to create symbolic links without administrator privileges.
If you use an earlier Windows versions, you need to run the build as administrator.
Run all tests
Make sure MONO_EXECUTABLE has been setup to use Visual Studio build Mono runtime, see above for instructions. For all tests to run and pass, the Cygwin shell will need elevated permissions. Without additional permissions, some test failures will be identified.