• Stars
    star
    10,755
  • Rank 2,993 (Top 0.07 %)
  • Language
    C#
  • License
    Other
  • Created almost 14 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Mono open source ECMA CLI, C# and .NET implementation.

Mono is a software platform designed to allow developers to easily create cross platform applications. It is an open source implementation of Microsoft's .NET Framework based on the ECMA standards for C# and the Common Language Runtime.

The Mono project is part of the .NET Foundation

Join us on Discord in the #monovm channel:

Contents

  1. Compilation and Installation
  2. Using Mono
  3. Directory Roadmap
  4. Contributing to Mono
  5. Reporting bugs
  6. Configuration Options
  7. Working with Submodules

Build Status

Public CI: Azure Pipelines

Legacy Jenkins CI (no longer available publicly):

OS Architecture Status
Debian 9 amd64 debian-9-amd64
Debian 9 i386 debian-9-i386
Debian 9 armel debian-9-armel
Debian 9 armhf debian-9-armhf
Debian 9 arm64 debian-9-arm64
OS X amd64 osx-amd64
OS X i386 osx-i386
Windows amd64 windows-amd64
Windows i386 windows-i386
CentOS s390x (cs) centos-s390x
Debian 9 ppc64el (cs) debian-9-ppc64el
AIX 6.1 ppc64 (cs) aix-ppc64
FreeBSD 12 amd64 (cs) freebsd-amd64

(cs) = community supported architecture

Compilation and Installation

Building the Software

Please see our guides for building Mono on Mac OS X, Linux and Windows.

Note that building from Git assumes that you already have Mono installed, so please download and install the latest Mono release before trying to build from Git. This is required because the Mono build relies on a working Mono C# compiler to compile itself (also known as bootstrapping).

If you don't have a working Mono installation

If you don't have a working Mono installation, you can try a slightly more risky approach: getting the latest version of the 'monolite' distribution, which contains just enough to run the 'mcs' compiler. You do this with:

# Run the following line after ./autogen.sh
make get-monolite-latest

This will download and place the files appropriately so that you can then just run:

make

The build will then use the files downloaded by make get-monolite-latest.

Testing and Installation

You can run the mono and mcs test suites with the command: make check.

Expect to find a few test suite failures. As a sanity check, you can compare the failures you got with https://jenkins.mono-project.com/.

You can now install mono with: make install

You can verify your installation by using the mono-test-install script, it can diagnose some common problems with Mono's install. Failure to follow these steps may result in a broken installation.

Using Mono

Once you have installed the software, you can run a few programs:

  • mono program.exe runtime engine

  • mcs program.cs C# compiler

  • monodis program.exe CIL Disassembler

See the man pages for mono(1), mcs(1) and monodis(1) for further details.

Directory Roadmap

  • acceptance-tests/ - Optional third party test suites used to validate Mono against a wider range of test cases.

  • data/ - Configuration files installed as part of the Mono runtime.

  • docs/ - Technical documents about the Mono runtime.

  • external/ - Git submodules for external libraries (Newtonsoft.Json, ikvm, etc).

  • ikvm-native/ - Glue code for ikvm.

  • libgc/ - The (deprecated) Boehm GC implementation.

  • llvm/ - Utility Makefiles for integrating the Mono LLVM fork.

  • m4/ - General utility Makefiles.

  • man/ - Manual pages for the various Mono commands and programs.

  • mcs/ - The class libraries, compiler and tools

    • class/ - The class libraries (like System.*, Microsoft.Build, etc.)

    • mcs/ - The Mono C# compiler written in C#

    • tools/ - Tools like gacutil, ikdasm, mdoc, etc.

  • mono/ - The core of the Mono Runtime.

    • arch/ - Architecture specific portions.

    • benchmark/ - A collection of benchmarks.

    • btls/ - Build files for the BTLS library which incorporates BoringSSL.

    • cil/ - Common Intermediate Representation, XML definition of the CIL bytecodes.

    • dis/ - CIL executable Disassembler.

    • eglib/ - Independent implementation of the glib API.

    • metadata/ - The object system and metadata reader.

    • mini/ - The Just in Time Compiler.

    • profiler/ - The profiler implementation.

    • sgen/ - The SGen Garbage Collector implementation.

    • tests/ - The main runtime tests.

    • unit-tests/ - Additional runtime unit tests.

    • utils/ - Utility functions used across the runtime codebase.

  • msvc/ - Logic for the MSVC / Visual Studio based runtime and BCL build system. The latter is experimental at the moment.

  • packaging/ - Packaging logic for the OS X and Windows Mono packages.

  • po/ - Translation files.

  • runtime/ - A directory that contains the Makefiles that link the mono/ and mcs/ build systems.

  • samples/ - Some simple sample programs on uses of the Mono runtime as an embedded library.

  • scripts/ - Scripts used to invoke Mono and the corresponding program.

  • support/ - Various support libraries.

  • tools/ - A collection of tools, mostly used during Mono development.

Contributing to Mono

Before submitting changes to Mono, please review the contribution guidelines. Please pay particular attention to the Important Rules section.

Reporting bugs

To submit bug reports, please open an issue on the mono GitHub repo.

Please use the search facility to ensure the same bug hasn't already been submitted and follow our guidelines on how to make a good bug report.

Configuration Options

The following are the configuration options that someone building Mono might want to use:

  • --with-sgen=yes,no - Generational GC support: Used to enable or disable the compilation of a Mono runtime with the SGen garbage collector.

    • On platforms that support it, after building Mono, you will have both a mono-boehm binary and a mono-sgen binary. mono-boehm uses Boehm, while mono-sgen uses the Simple Generational GC.
  • --with-libgc=[included, none] - Selects the default Boehm garbage collector engine to use.

    • included: (slightly modified Boehm GC) This is the default value for the Boehm GC, and it's the most feature complete, it will allow Mono to use typed allocations and support the debugger.

    • none: Disables the inclusion of a Boehm garbage collector.

    • This defaults to included.

  • --enable-cooperative-suspend

    • If you pass this flag the Mono runtime is configured to only use the cooperative mode of the garbage collector. If you do not pass this flag, then you can control at runtime the use of the cooperative GC mode by setting the MONO_ENABLE_COOP_SUSPEND flag.
  • --with-tls=__thread,pthread

    • Controls how Mono should access thread local storage, pthread forces Mono to use the pthread APIs, while __thread uses compiler-optimized access to it.

    • Although __thread is faster, it requires support from the compiler, kernel and libc. Old Linux systems do not support with __thread.

    • This value is typically pre-configured and there is no need to set it, unless you are trying to debug a problem.

  • --with-sigaltstack=yes,no

    • Experimental: Use at your own risk, it is known to cause problems with garbage collection and is hard to reproduce those bugs.

    • This controls whether Mono will install a special signal handler to handle stack overflows. If set to yes, it will turn stack overflows into the StackOverflowException. Otherwise when a stack overflow happens, your program will receive a segmentation fault.

    • The configure script will try to detect if your operating system supports this. Some older Linux systems do not support this feature, or you might want to override the auto-detection.

  • --with-static_mono=yes,no

    • This controls whether mono should link against a static library (libmono.a) or a shared library (libmono.so).

    • This defaults to yes, and will improve the performance of the mono program.

    • This only affects the `mono' binary, the shared library libmono.so will always be produced for developers that want to embed the runtime in their application.

  • --with-xen-opt=yes,no - Optimize code for Xen virtualization.

    • It makes Mono generate code which might be slightly slower on average systems, but the resulting executable will run faster under the Xen virtualization system.

    • This defaults to yes.

  • --with-large-heap=yes,no - Enable support for GC heaps larger than 3GB.

    • This only applies only to the Boehm garbage collector, the SGen garbage collector does not use this configuration option.

    • This defaults to no.

  • --enable-small-config=yes,no - Enable some tweaks to reduce memory usage and disk footprint at the expense of some capabilities.

    • Typically this means that the number of threads that can be created is limited (256), that the maximum heap size is also reduced (256 MB) and other such limitations that still make mono useful, but more suitable to embedded devices (like mobile phones).

    • This defaults to no.

  • --with-ikvm-native=yes,no - Controls whether the IKVM JNI interface library is built or not.

    • This is used if you are planning on using the IKVM Java Virtual machine with Mono.

    • This defaults to yes.

  • --with-profile4=yes,no - Whether you want to build the 4.x profile libraries and runtime.

    • This defaults to yes.
  • --with-libgdiplus=installed,sibling,<path> - Configure where Mono searches for libgdiplus when running System.Drawing tests.

    • It defaults to installed, which means that the library is available to Mono through the regular system setup.

    • sibling can be used to specify that a libgdiplus that resides as a sibling of this directory (mono) should be used.

  • Or you can specify a path to a libgdiplus.

  • --enable-minimal=LIST

    • Use this feature to specify optional runtime components that you might not want to include. This is only useful for developers embedding Mono that require a subset of Mono functionality.

    • The list is a comma-separated list of components that should be removed, these are:

      • aot: Disables support for the Ahead of Time compilation.

      • attach: Support for the Mono.Management assembly and the VMAttach API (allowing code to be injected into a target VM)

      • com: Disables COM support.

      • debug: Drop debugging support.

      • decimal: Disables support for System.Decimal.

      • full_messages: By default Mono comes with a full table of messages for error codes. This feature turns off uncommon error messages and reduces the runtime size.

      • generics: Generics support. Disabling this will not allow Mono to run any 2.0 libraries or code that contains generics.

      • jit: Removes the JIT engine from the build, this reduces the executable size, and requires that all code executed by the virtual machine be compiled with Full AOT before execution.

      • large_code: Disables support for large assemblies.

      • logging: Disables support for debug logging.

      • pinvoke: Support for Platform Invocation services, disabling this will drop support for any libraries using DllImport.

      • portability: Removes support for MONO_IOMAP, the environment variables for simplifying porting applications that are case-insensitive and that mix the Unix and Windows path separators.

      • profiler: Disables support for the default profiler.

      • reflection_emit: Drop System.Reflection.Emit support

      • reflection_emit_save: Drop support for saving dynamically created assemblies (AssemblyBuilderAccess.Save) in System.Reflection.Emit.

      • shadow_copy: Disables support for AppDomain's shadow copies (you can disable this if you do not plan on using appdomains).

      • simd: Disables support for the Mono.SIMD intrinsics library.

      • ssa: Disables compilation for the SSA optimization framework, and the various SSA-based optimizations.

  • --enable-llvm

    • This enables the use of LLVM as a code generation engine for Mono. The LLVM code generator and optimizer will be used instead of Mono's built-in code generator for both Just in Time and Ahead of Time compilations.

    • See https://www.mono-project.com/docs/advanced/mono-llvm/ for the full details and up-to-date information on this feature.

    • You will need to have an LLVM built that Mono can link against.

  • --enable-big-arrays - Enable use of arrays with indexes larger than Int32.MaxValue.

    • By default Mono has the same limitation as .NET on Win32 and Win64 and limits array indexes to 32-bit values (even on 64-bit systems).

    • In certain scenarios where large arrays are required, you can pass this flag and Mono will be built to support 64-bit arrays.

    • This is not the default as it breaks the C embedding ABI that we have exposed through the Mono development cycle.

  • --enable-parallel-mark

    • Use this option to enable the garbage collector to use multiple CPUs to do its work. This helps performance on multi-CPU machines as the work is divided across CPUS.

    • This option is not currently the default on OSX as it runs into issues there.

    • This option only applies to the Boehm GC.

  • --enable-dtrace

    • On Solaris and MacOS X builds a version of the Mono runtime that contains DTrace probes and can participate in the system profiling using DTrace.
  • --disable-dev-random

    • Mono uses /dev/random to obtain good random data for any source that requires random numbers. If your system does not support this, you might want to disable it.

    • There are a number of runtime options to control this also, see the man page.

  • --with-csc=roslyn,mcs,default

    • Use this option to configure which C# compiler to use. By default the configure script will pick Roslyn, except on platforms where Roslyn does not work (Big Endian systems) where it will pick mcs.

      If you specify "mcs", then Mono's C# compiler will be used. This also allows for a complete bootstrap of Mono's core compiler and core libraries from source.

  If you specify "roslyn", then Roslyn's C# compiler will be used. This currently uses Roslyn binaries.

  • --enable-nacl

    • This configures the Mono compiler to generate code suitable to be used by Google's Native Client: https://code.google.com/p/nativeclient/

    • Currently this is used with Mono's AOT engine as Native Client does not support JIT engines yet.

  • --enable-wasm

    • Use this option to configure mono to run on WebAssembly. It will set both host and target to the WebAssembly triplet. This overrides the values passed to --host or --target and ignored what config.sub guesses.

      This is a workaround to enable usage of old automake versions that don't recognize the wasm triplet.

Working With Submodules

Mono references several external git submodules, for example a fork of Microsoft's reference source code that has been altered to be suitable for use with the Mono runtime.

This section describes how to use it.

An initial clone should be done recursively so all submodules will also be cloned in a single pass:

$ git clone --recursive [email protected]:mono/mono

Once cloned, submodules can be updated to pull down the latest changes. This can also be done after an initial non-recursive clone:

$ git submodule update --init --recursive

To pull external changes into a submodule:

$ cd <submodule>
$ git pull origin <branch>
$ cd <top-level>
$ git add <submodule>
$ git commit

By default, submodules are detached because they point to a specific commit. Use git checkout to move back to a branch before making changes:

$ cd <submodule>
$ git checkout <branch>
# work as normal; the submodule is a normal repo
$ git commit/push new changes to the repo (submodule)

$ cd <top-level>
$ git add <submodule> # this will record the new commits to the submodule
$ git commit

To switch the repo of a submodule (this should not be a common or normal thing to do at all), first edit .gitmodules to point to the new location, then:

$ git submodule sync -- <path of the submodule>
$ git submodule update --recursive
$ git checkout <desired new hash or branch>

The desired output diff is a change in .gitmodules to reflect the change in the remote URL, and a change in / where you see the desired change in the commit hash.

License

See the LICENSE file for licensing information, and the PATENTS.TXT file for information about Microsoft's patent grant.

Mono Trademark Use Policy

The use of trademarks and logos for Mono can be found here.

More Repositories

1

SkiaSharp

SkiaSharp is a cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library. It provides a comprehensive 2D API that can be used across mobile, server and desktop models to render images.
C#
4,046
star
2

CppSharp

Tools and libraries to glue C/C++ APIs to high-level languages
C#
2,919
star
3

monodevelop

MonoDevelop is a cross platform .NET IDE
C#
2,797
star
4

xwt

A cross-platform UI toolkit for creating desktop applications with .NET and Mono
C#
1,357
star
5

taglib-sharp

Library for reading and writing metadata in media files
C#
1,225
star
6

Embeddinator-4000

Tools to turn .NET libraries into native libraries that can be consumed on Android, iOS, Mac, Linux and other platforms.
C#
759
star
7

VulkanSharp

Open source .NET binding for the Vulkan API
C#
532
star
8

CocosSharp

CocosSharp is a C# implementation of the Cocos2D and Cocos3D APIs that runs on any platform where MonoGame runs.
C#
492
star
9

monotouch-bindings

A collection of third party bindings for MonoTouch
C#
451
star
10

gtk-sharp

Gtk# is a Mono/.NET binding to the cross platform Gtk+ GUI toolkit and the foundation of most GUI apps built with Mono
C#
418
star
11

sharpen

Sharpen is an Eclipse plugin created by db4o that allows you to convert your Java project into c#
Java
378
star
12

t4

T4 text templating engine
C#
351
star
13

website

Mono's web site.
HTML
344
star
14

libgdiplus

C-based implementation of the GDI+ API
C
311
star
15

monomac

Bindings to create MacOS X applications with Mono.
C#
260
star
16

ngit

Automated jgit port to c#
C#
260
star
17

LineEditor

LineEditor is an interactive line editor for Command Line applications in .NET
C#
234
star
18

SkiaSharp.Extended

SkiaSharp is a cross-platform, comprehensive 2D graphics API for all .NET platforms. And, here is where you will find all sorts of extras that you can use with it.
C#
205
star
19

cxxi

C++ interop framework
C#
199
star
20

xsp

Mono's ASP.NET hosting server. This module includes an Apache Module, a FastCGI module that can be hooked to other web servers as well as a standalone server used for testing (similar to Microsoft's Cassini)
C#
192
star
21

roslyn

Roslyn Compiler - Tracks Mono Patches
C#
185
star
22

mono-tools

The mono-tools package contains a series of extra tools for Mono users.
C#
163
star
23

mono-addins

Mono.Addins is a generic framework for creating extensible applications, and for creating add-ins which extend those applications.
C#
163
star
24

docker

Docker images, for the Docker container system
Dockerfile
161
star
25

moon

Moonlight, an open source implementation of Silverlight for Unix systems
C#
156
star
26

mono-curses

Mono/.NET bindings to the Unix Curses as well as GUI framework for creating text applications with Curses
C#
137
star
27

winforms

Winforms samples for use with Mono's implementation of System.Windows.Forms
C#
130
star
28

aspnetwebstack

Mono branch of Microsoft's ASP.NET WebStack
C#
119
star
29

sdb

A command line client for the Mono soft debugger.
C#
117
star
30

opentk

OpenTK is a set of bindings to OpenGL, OpenCL and OpenAL. This is not the main repository, just a temporary import to allow Mono developers to make changes to this module. Please do not contribute changes here, contribute them to the upstream maintainers at http://www.opentk.com
C#
113
star
31

cocos-sharp-samples

CocosSharp samples
C#
112
star
32

ikvm-fork

A fork of the original cvs based IKVM repository
C#
102
star
33

mono-basic

Visual Basic Compiler and Runtime
Visual Basic .NET
101
star
34

TsToCSharp

Emit C# strongly typed interface code from TypeScript definition files.
TypeScript
92
star
35

mono-upnp

UPNP binding for Mono/.NET
C#
85
star
36

dbus-sharp

DBus Sharp
C#
75
star
37

md-website

MonoDevelop WebSite
HTML
74
star
38

debugger-libs

Debugger libraries
C#
74
star
39

webkit-sharp

C#/CLI bindings to WebKit/Gtk+
C#
68
star
40

sysdrawing-coregraphics

System.Drawing implementation using CoreGraphics.
C#
66
star
41

api-doc-tools

.NET Reference API Toolchain
C#
65
star
42

maccore

MacCore contains the shared code between MonoTouch and MonoMac
C#
63
star
43

Mono.Zeroconf

Cross platform ZeroConf client that works with the underlying ZeroConf stack on the platform for Mono and .NET
C#
60
star
44

mwf-designer

Windows.Forms designer for Mono. Work in progress
C#
45
star
45

heap-shot

C#
42
star
46

cecil-old

ECMA CIL Manipulation Library
C#
41
star
47

tao

The Tao OpenGL, OpenAL, GLU, FreeGlut bindings for .NET and Mono
C#
38
star
48

monodroid-bindings

Mono for Android Jar Bindings
C#
36
star
49

entityframework

C#
33
star
50

monkeywrench

Continuous build system used by Mono and Moonlight.
C#
33
star
51

reference-assemblies

Binary reference assemblies
C#
32
star
52

linux-packaging-mono

Packaging metadata for mono-project.com packages
30
star
53

mod_mono

Apache module to host the XSP ASP.NET host
C
30
star
54

mono.posix

POSIX/Unix interface for Mono, .NET and .NET Core. Provides functionality for managed code to access POSIX/Unix features not accessible via the BCL. This repository supersedes the older code in https://github.com/mono/mono
C#
29
star
55

jurassic

Mono port of the Jurassic JS Engine (http://jurassic.codeplex.com/).
C#
27
star
56

mono-tls

New TLS implementation for Mono.
C#
27
star
57

bockbuild

Build & packaging system, responsible for the Mono project distribution for Mac
Python
26
star
58

xamarin-gtk-theme

C
25
star
59

uia2atk

Accessibility bridge between UIA and Gnome's ATK
C#
20
star
60

csvorbis

C#
20
star
61

linux-packaging-msbuild

C#
19
star
62

SkiaSharp-API-docs

SkiaSharp and HarfBuzzSharp API reference docs
PowerShell
19
star
63

mono-webbrowser

Browser backends for Mono.WebBrowser
C#
18
star
64

moma

Mono Migration Analyzer. A tool to scan compiled assemblies and determine their compatibility with Mono.
C#
18
star
65

olive

Olive is an incubation module used to host new Mono code under development based on Microsoft's APIs. Olive code eventually graduates and is moved into the Mono distribution.
C#
16
star
66

monocov

Mono Code Coverage profiler module
C#
15
star
67

monodevelop-flatpak

Makefile
14
star
68

debugger

Mono Hard Debugger
C
14
star
69

guiunit

A unit test runner which interoperates with any Gui main loop
C#
13
star
70

repo

This is the mono repo - we'll put everything here
13
star
71

gtk-sharp-ribbon

C#
13
star
72

gir-sharp

C# binding generator for GIR format
C#
12
star
73

lb

Lame Blog, the lamest blog engine in the world
C#
12
star
74

monologue

Monologue is Mono's blog aggregation software for the Mono community
C#
11
star
75

WindowsAPICodePack

WindowsAPICodePack as imported from MonoDevelop
C#
11
star
76

gluezilla

C
10
star
77

roslyn-binaries

Pre-built binaries of Roslyn
C#
10
star
78

stetic

The Gtk# GUI designer
C#
10
star
79

pty-sharp

API for managing Unix pseudo-terminals from managed code
C
9
star
80

mono-microthreads

Microthreads implementation built on top of Mono.Tasklets library
C#
9
star
81

gnome-keyring-sharp

Bindings to Gnome's KeyRing APIs
C#
8
star
82

nuget-binary

Temporary repo to hold nuget binaries for use with MonoDevelop
8
star
83

winforms-tools

Open source Windows.Forms tools.
C#
8
star
84

old-code

Old mono code that has not been developed in years
C#
8
star
85

gio-sharp

Bindings to Glib's libgio
C#
8
star
86

gnome-sharp

Bindings to the core Gnome APIs
C#
8
star
87

crimson

C#
8
star
88

mooncodecs

open source codecs that can be plugged into Moonlight or Silverlight applications
C#
7
star
89

rocks

Mono.Rocks is a library of utility functions
C#
7
star
90

release

(Deprecated, no longer used) Tools to manage Mono's releases (scripts, web pages, build files)
HTML
7
star
91

WebAssembly.JSInterop

WebAssembly JSInterop library
JavaScript
7
star
92

Mono.Simd.Math

Math library that uses Mono's accelerated Mono.Simd library
C#
6
star
93

nuget

Nuget
C#
6
star
94

monohotdraw

Vector drawing program
C#
6
star
95

dbus-sharp-glib

Managed dbus
C#
6
star
96

eglib

C
6
star
97

heap-buddy

C#
6
star
98

boringssl

Custom version of Boring SSL used by Mono
C
6
star
99

google-sharp

C#
6
star
100

linux-packaging-fsharp

Packaging metadata for mono-project.com packages
F#
6
star