mcs
mono C# compiler
TLDR
SYNOPSIS
mcs [options] files
DESCRIPTION
mcs is the Mono C# compiler. It compiles C# source code into Common Intermediate Language (CIL) assemblies that run on the Mono or .NET runtime. It supports C# language versions up to C# 7.Options use a colon separator (e.g., `-out:file.exe`, `-target:library`) following Microsoft csc conventions, though the alternate syntax with a space is also accepted in many cases.
PARAMETERS
FILES
C# source files to compile.-out:FILE
Output file name.-target:TYPE
Output type: exe (console app, default), library (DLL), module, or winexe (GUI app).-r:ASSEMBLY
Reference an external assembly.-debug
Emit debugging information.-optimize
Enable compiler optimizations.-define:SYMBOL
Define a preprocessor symbol.-pkg:PACKAGE
Reference packages registered with pkg-config.-recurse:PATTERN
Compile all files matching the pattern recursively.-warn:LEVEL
Set warning level (0-4, default 4).-warnaserror
Treat warnings as errors.-nowarn:NUMBERS
Suppress specified warning numbers.-unsafe
Enable compilation of unsafe code.-checked
Enable overflow checking.-main:CLASS
Specify which class contains the Main entry point.-lib:PATHLIST
Comma-separated list of directories to search for assemblies.-sdk:VERSION
Specify Base Class Library version (2 or 4, default 4).-noconfig
Disable loading the default compiler configuration.-langversion:VERSION
Specify C# language version (e.g., default, latest, ISO-1, ISO-2, 3-7).--help
Display help information.
CAVEATS
Part of the Mono framework. The Mono project has been largely superseded by .NET (Core/.NET 5+) and the Roslyn-based csc compiler. New projects should prefer dotnet build or csc. Language support stops at C# 7; newer C# features require Roslyn.
HISTORY
mcs is the Mono project's C# compiler, originally written by Miguel de Icaza and the Mono team. It was one of the first open-source implementations of the C# compiler, enabling .NET development on Linux and macOS before Microsoft open-sourced .NET.
