1Mono(mono)                                                          Mono(mono)
2
3
4

NAME

6       mono  -  Mono's ECMA-CLI native code generator (Just-in-Time and Ahead-
7       of-Time)
8

SYNOPSIS

10       mono [options] file [arguments...]
11
12       mono-sgen [options] file [arguments...]
13

DESCRIPTION

15       mono is a runtime implementation of the  ECMA  Common  Language  Infra‐
16       structure.  This can be used to run ECMA and .NET applications.
17
18       The  runtime  loads  the specified file and optionally passes the argu‐
19       ments to it.  The file is an ECMA assembly.  They typically have a .exe
20       or .dll extension.
21
22       These executables can reference additional functionality in the form of
23       assembly references.  By default those assembly references are resolved
24       as  follows:  the mscorlib.dll is resolved from the system profile that
25       is configured by Mono, and other assemblies are loaded from the  Global
26       Assembly Cache (GAC).
27
28       The runtime contains a native code generator that transforms the Common
29       Intermediate Language into native code.
30
31       The code generator can operate in two modes:  Just-in-time  compilation
32       (JIT)  or  Ahead-of-time  compilation (AOT).  Since code can be dynami‐
33       cally loaded, the runtime environment and the JIT are  always  present,
34       even if code is compiled ahead of time.
35
36       The  runtime provides a number of configuration options for running ap‐
37       plications, for developing and debugging, and for testing and debugging
38       the runtime itself.
39
40       The  mono command uses the moving and generational SGen garbage collec‐
41       tor while the mono-boehm command uses the  conservative  Boehm  garbage
42       collector.
43

PORTABILITY

45       On  Unix-based  systems,  Mono provides a mechanism to emulate the Win‐
46       dows-style file access, this includes providing a case insensitive view
47       of  the  file  system,  directory  separator  mapping (from \ to /) and
48       stripping the drive letters.
49
50       This functionality is enabled by  setting  the  MONO_IOMAP  environment
51       variable to one of all, drive and case.
52
53       See the description for MONO_IOMAP in the environment variables section
54       for more details.
55

METHOD DESCRIPTIONS

57       A number of diagnostic command line options take as argument  a  method
58       description.    A  method  description is a textual representation that
59       can be used to uniquely identify a method.   The syntax is as follows:
60       [namespace]classname:methodname[(arguments)]
61
62       The values in brackets are optional, like the namespace and  the  argu‐
63       ments.    The  arguments  themselves are either empty, or a comma-sepa‐
64       rated list of arguments.   Both the classname and methodname can be set
65       to  the  special value '*' to match any values (Unix shell users should
66       escape the argument to avoid the shell interpreting this).
67
68       The arguments, if present should be a comma separated list of types ei‐
69       ther a full typename, or for built-in types it should use the low-level
70       ILAsm type names for the built-in types, like 'void',  'char',  'bool',
71       'byte', 'sbyte', 'uint16', 'int16', 'uint',
72
73       Pointer types should be the name of the type, followed by a '*', arrays
74       should be the typename followed by '[' one or more commas (to  indicate
75       the rank of the array), and ']'.
76
77       Generic  values  should  use  '<', one or more type names, separated by
78       both a comma and a space and '>'.
79
80       By-reference arguments should include a "&" after the typename.
81
82       Examples:
83       *:ctor(int)         // All constructors that take an int as an argument
84       *:Main              // Methods named Main in any class
85       *:Main(string[])    // Methods named Main that take a string array in any class
86

RUNTIME OPTIONS

88       The following options are available:
89
90       --aot, --aot[=options]
91              This option is used to precompile the CIL code in the  specified
92              assembly to native code.  The generated code is stored in a file
93              with the extension .so.  This file will be automatically  picked
94              up  by the runtime when the assembly is executed.  Ahead-of-Time
95              compilation is most useful if you use it in combination with the
96              -O=all,-shared  flag  which  enables all of the optimizations in
97              the code generator to be performed.  Some of those optimizations
98              are  not practical for Just-in-Time compilation since they might
99              be very time consuming.  Unlike the  .NET  Framework,  Ahead-of-
100              Time  compilation  will not generate domain independent code: it
101              generates the same code that  the  Just-in-Time  compiler  would
102              produce.    Since most applications use a single domain, this is
103              fine.   If you want to optimize the generated code  for  use  in
104              multi-domain  applications,  consider  using the -O=shared flag.
105              This pre-compiles the methods,  but  the  original  assembly  is
106              still  required to execute as this one contains the metadata and
107              exception information which is not available  on  the  generated
108              file.   When  precompiling  code, you might want to compile with
109              all optimizations (-O=all).  Pre-compiled code is position inde‐
110              pendent  code.   Precompilation  is  just  a mechanism to reduce
111              startup time, increase code sharing across  multiple  mono  pro‐
112              cesses and avoid just-in-time compilation program startup costs.
113              The original assembly must still be present, as the metadata  is
114              contained  there.   AOT code typically can not be moved from one
115              computer to another (CPU-specific  optimizations  that  are  de‐
116              tected  at runtime) so you should not try to move the pre-gener‐
117              ated assemblies or package the pre-generated assemblies for  de‐
118              ployment.   A  few  options  are available as a parameter to the
119              --aot command line option.   The options are separated  by  com‐
120              mas, and more than one can be specified:
121
122              asmonly
123                     Instructs  the  AOT  compiler to output assembly code in‐
124                     stead of an object file.
125
126              bind-to-runtime-version
127                     If specified, forces the generated AOT files to be  bound
128                     to the runtime version of the compiling Mono.   This will
129                     prevent the AOT files from being consumed by a  different
130                     Mono runtime.
131
132              data-outfile=FILE.dll.aotdata
133                     This  instructs  the AOT code generator to output certain
134                     data constructs into a separate file.   This  can  reduce
135                     the  executable images some five to twenty percent.   De‐
136                     velopers need to then ship the resulting aotdata as a re‐
137                     source  and register a hook to load the data on demand by
138                     using the mono_install_load_aot_data_hook method.
139
140              direct-icalls
141                     When this option is  specified,  icalls  (internal  calls
142                     made  from  the  standard  library  into the mono runtime
143                     code) are invoked directly instead of going  through  the
144                     operating  system symbol lookup operation.  This requires
145                     use of the static option.
146
147              direct-pinvoke
148                     When this option is specified, P/Invoke methods  are  in‐
149                     voked  directly  instead  of  going through the operating
150                     system symbol lookup operation.  This requires use of the
151                     static option.
152
153              dwarfdebug
154                     Instructs the AOT compiler to emit DWARF debugging infor‐
155                     mation. When used together with the nodebug option,  only
156                     DWARF  debugging  information is emitted, but not the in‐
157                     formation that can be used at runtime.
158
159              full   This creates binaries which can be used with the  --full-
160                     aot option.
161
162              hybrid This  creates  binaries  which can be used with the --hy‐
163                     brid-aot option.
164
165              llvm   AOT will be performed with the LLVM  backend  instead  of
166                     the  Mono  backend where possible. This will be slower to
167                     compile but most likely result in a performance  improve‐
168                     ment.
169
170              llvmonly
171                     AOT  will  be performed with the LLVM backend exclusively
172                     and the Mono backend will not be used. The only output in
173                     this  mode  will  be  the bitcode file normally specified
174                     with the llvm-outfile option. Use of  llvmonly  automati‐
175                     cally  enables the full and llvm options. This feature is
176                     experimental.
177
178              llvmopts=[options]
179                     Use this option to add more flags to the built-in set  of
180                     flags passed to the LLVM optimizer.   When you invoke the
181                     mono command with the --aot=llvm it displays the  current
182                     list  of  flags that are being passed to the opt command.
183                     The list of possible flags that can be passed can be  ob‐
184                     tained by calling the bundled opt program that comes with
185                     Mono, and calling it like this:
186
187                          opt --help
188
189
190
191              llvmllc=[options]
192                     Use this option to add more flags to the built-in set  of
193                     flags  passed  to  the  LLVM static compiler (llc).   The
194                     list of possible flags that can be passed can be obtained
195                     by  calling the bundled llc program that comes with Mono,
196                     and calling it like this:
197
198                          llc --help
199
200
201              mcpu=[native o generic]
202                     cpu=native allows AOT mode to use all  instructions  cur‐
203                     rent  CPU supports, e.g. AVX2, SSE42, etc.  Default value
204                     is 'generic'.  mattr=[cpu feature] Allows AOT code gener‐
205                     ator to use specified CPU features where possible includ‐
206                     ing         `System.Runtime.Intrinsics.*'.           E.g.
207                     `mattr=+avx2,mattr=-lzcnt'  unlocks  sse1-4.2, avx1-2 and
208                     disables lzcnt.  It's  useful  for  cross-compilation  or
209                     when  it's  not possible to use `-mcpu=native' (which en‐
210                     ables  all  cpu  feature  current  cpu  has).   llvm-out‐
211                     file=[filename]  Gives  the  path  for the temporary LLVM
212                     bitcode file created during AOT.  dedup Each  AOT  module
213                     will  typically contain the code for inflated methods and
214                     wrappers that are called by code in that module. In dedup
215                     mode,  we  identify and skip compiling all of those meth‐
216                     ods. When using this mode with fullaot, dedup-include  is
217                     required or these methods will remain missing.
218
219              dedup-include=[filename]
220                     In  dedup-include mode, we are in the pass of compilation
221                     where we compile  the  methods  that  we  had  previously
222                     skipped.  All  of them are emitted into the assembly that
223                     is passed as this option. We consolidate the many  dupli‐
224                     cate skipped copies of the same method into one.
225
226
227              info   Print  the architecture the AOT in this copy of Mono tar‐
228                     gets and quit.
229
230              interp Generates all required wrappers, so that it  is  possible
231                     to  run --interpreter without any code generation at run‐
232                     time.  This option only makes  sense  with  mscorlib.dll.
233                     Embedders can set
234
235              depfile=[filename]
236                     Outputs a gcc -M style dependency file.
237
238                     mono_jit_set_aot_mode (MONO_AOT_MODE_INTERP);
239
240              ld-flags
241                     Additional  flags to pass to the C linker (if the current
242                     AOT mode calls for invoking it).
243
244              llvm-path=<PREFIX>
245                     Same for the llvm tools 'opt' and 'llc'.
246
247              msym-dir=<PATH>
248                     Instructs the AOT compiler to generate  offline  sequence
249                     points  .msym  files.   The generated .msym files will be
250                     stored into a subfolder of <PATH> named as  the  compila‐
251                     tion AOTID.
252
253              mtriple=<TRIPLE>
254                     Use  the  GNU  style  target triple <TRIPLE> to determine
255                     some      code       generation       options,       i.e.
256                     --mtriple=armv7-linux-gnueabi  will  generate  code  that
257                     targets ARMv7. This is currently only  supported  by  the
258                     ARM  backend.  In  LLVM mode, this triple is passed on to
259                     the LLVM llc compiler.
260
261              nimt-trampolines=[number]
262                     When compiling in full aot mode, the IMT trampolines must
263                     be  precreated  in the AOT image.  You can add additional
264                     method trampolines with this argument.  Defaults to 512.
265
266              ngsharedvt-trampolines=[number]
267                     When compiling in full aot mode, the value  type  generic
268                     sharing  trampolines must be precreated in the AOT image.
269                     You can add additional method trampolines with this argu‐
270                     ment.  Defaults to 512.
271
272              nodebug
273                     Instructs  the  AOT  compiler to not output any debugging
274                     information.
275
276              no-direct-calls
277                     This prevents the AOT compiler from generating  a  direct
278                     calls  to  a method.   The AOT compiler usually generates
279                     direct calls for certain methods that do not require  go‐
280                     ing  through the PLT (for example, methods that are known
281                     to not require a hook like a static constructor) or  call
282                     into simple internal calls.
283
284              nrgctx-trampolines=[number]
285                     When  compiling  in  full  aot  mode, the generic sharing
286                     trampolines must be precreated in the AOT image.  You can
287                     add  additional  method  trampolines  with this argument.
288                     Defaults to 4096.
289
290              nrgctx-fetch-trampolines=[number]
291                     When compiling in full  aot  mode,  the  generic  sharing
292                     fetch  trampolines  must  be precreated in the AOT image.
293                     You can add additional method trampolines with this argu‐
294                     ment.  Defaults to 128.
295
296              ntrampolines=[number]
297                     When  compiling  in full aot mode, the method trampolines
298                     must be precreated in the AOT image.  You can  add  addi‐
299                     tional  method  trampolines with this argument.  Defaults
300                     to 4096.
301
302              outfile=[filename]
303                     Instructs the AOT compiler to  save  the  output  to  the
304                     specified file.
305
306              print-skipped-methods
307                     If  the AOT compiler cannot compile a method for any rea‐
308                     son, enabling this flag will output the  skipped  methods
309                     to the console.
310
311              profile=[file]
312                     Specify  a  file  to use for profile-guided optimization.
313                     See the AOT profiler  sub-section.  To  specify  multiple
314                     files, include the profile option multiple times.
315
316              profile-only
317                     AOT  *only*  the methods described in the files specified
318                     with the profile option. See the  AOT  profiler  sub-sec‐
319                     tion.
320
321              readonly-value=namespace.typename.fieldname=type/value
322                     Override  the  value of a static readonly field. Usually,
323                     during JIT compilation, the static constructor is ran ea‐
324                     gerly,  so  the value of a static readonly field is known
325                     at compilation time and the compiler can do a  number  of
326                     optimizations  based  on  it.  During  AOT,  instead, the
327                     static constructor can't be ran, so this  option  can  be
328                     used to set the value of such a field and enable the same
329                     set of optimizations.  Type can be any of i1, i2, i4  for
330                     integers  of  the respective sizes (in bytes).  Note that
331                     signed/unsigned numbers do  not  matter  here,  just  the
332                     storage  size.   This  option  can  be specified multiple
333                     times and it doesn't prevent the static  constructor  for
334                     the  type  defining  the  field to execute with the usual
335                     rules at runtime (hence possibly  computing  a  different
336                     value for the field).
337
338              save-temps,keep-temps
339                     Instructs the AOT compiler to keep temporary files.
340
341              soft-debug
342                     This  instructs  the  compiler to generate sequence point
343                     checks that allow Mono's soft debugger to debug  applica‐
344                     tions  even  on  systems  where it is not possible to set
345                     breakpoints or to single step (certain hardware  configu‐
346                     rations like the cell phones and video gaming consoles).
347
348              static Create  an  ELF  object file (.o) or .s file which can be
349                     statically linked into an executable when  embedding  the
350                     mono  runtime.  When this option is used, the object file
351                     needs to be registered with the  embedded  runtime  using
352                     the  mono_aot_register_module function which takes as its
353                     argument the mono_aot_module_<ASSEMBLY NAME>_info  global
354                     symbol from the object file:
355
356                     extern void *mono_aot_module_hello_info;
357
358                     mono_aot_register_module (mono_aot_module_hello_info);
359
360              stats  Print various stats collected during AOT compilation.
361
362              temp-path=[path]
363                     Explicitly  specify path to store temporary files created
364                     during AOT compilation.
365
366              threads=[number]
367                     This is an experimental option for the  AOT  compiler  to
368                     use multiple threads when compiling the methods.
369
370              tool-prefix=<PREFIX>
371                     Prepends  <PREFIX>  to  the  name of tools ran by the AOT
372                     compiler, i.e. 'as'/'ld'. For example, --tool=prefix=arm-
373                     linux-gnueabi- will make the AOT compiler run
374
375              ld-name=NAME
376                     One  of  the tools used for AOT builds is the linker. Its
377                     name differs between various systems and  it  may  happen
378                     that  the  assumed  default  name  of  the  binary is not
379                     present.  If the toolchain used does not  have  a  linker
380                     with the default name (e.g. Android NDK r22 does not have
381                     the  default  'ld'  linker  prefixed  with  'tool-prefix'
382                     above,  instead  it  has  prefixed 'ld.gold' and 'ld.bfd'
383                     linkers) this option can be used to set the linker binary
384                     name.  It will be prefixed with 'tool-prefix' to form the
385                     full linker executable name.
386
387              verbose
388                     Prints additional information about  type  loading  fail‐
389                     ures.
390
391              write-symbols,no-write-symbols
392                     Instructs  the  AOT  compiler to emit (or not emit) debug
393                     symbol information.
394
395              no-opt Instructs the AOT compiler tot no call opt when compiling
396                     with LLVM.
397
398              For   more   information   about   AOT,   see:  http://www.mono-
399              project.com/docs/advanced/aot/
400
401       --aot-path=PATH
402              List of additional directories to search for AOT images.
403
404       --apply-bindings=FILE
405              Apply the assembly bindings  from  the  specified  configuration
406              file when running the AOT compiler.  This is useful when compil‐
407              ing an auxiliary assembly that is referenced by a main  assembly
408              that  provides  a  configuration  file.  For example, if app.exe
409              uses lib.dll then in order to make the  assembly  bindings  from
410              app.exe.config  available  when compiling lib.dll ahead of time,
411              use:
412                   mono --apply-bindings=app.exe.config --aot lib.dll
413
414       --assembly-loader=MODE
415              If mode is strict, Mono will check that the  public  key  token,
416              culture  and  version  of  a  candidate assembly matches the re‐
417              quested strong name.  If mode is legacy, as  long  as  the  name
418              matches,  the  candidate will be allowed. strict is the behavior
419              consistent with .NET Framework but may break some existing mono-
420              based applications.  The default is legacy.
421
422       --attach=[options]
423              Currently  the  only option supported by this command line argu‐
424              ment is disable which disables the attach functionality.
425
426       --config filename
427              Load the specified configuration file  instead  of  the  default
428              one(s).  The default files are /etc/mono/config and ~/.mono/con‐
429              fig or the file specified in the MONO_CONFIG  environment  vari‐
430              able,  if  set.   See the mono-config(5) man page for details on
431              the format of this file.
432
433       --debugger-agent=[options]
434              This instructs the Mono runtime to start a debugging  agent  in‐
435              side  the Mono runtime and connect it to a client user interface
436              will control the Mono process.  This option is typically used by
437              IDEs, like the MonoDevelop or Visual Studio IDEs.
438              The  configuration is specified using one of more of the follow‐
439              ing options:
440
441                     address=host:port
442                            Use this option to specify the  IP  address  where
443                            your debugger client is listening to.
444
445                     loglevel=LEVEL
446                            Specifies the diagnostics log level for
447
448                     logfile=filename
449                            Used  to  specify  the  file where the log will be
450                            stored, it defaults to standard output.
451
452                     server=[y/n]
453                            Defaults to no, with the default option Mono  will
454                            actively  connect to the host/port configured with
455                            the address option.  If you set it to 'y', it  in‐
456                            structs  the  Mono  runtime  to start debugging in
457                            server mode, where Mono actively waits for the de‐
458                            bugger  front  end to connect to the Mono process.
459                            Mono will print out to stdout the IP  address  and
460                            port where it is listening.
461
462                     setpgid=[y/n]
463                            If  set  to  yes,  Mono will call setpgid(0, 0) on
464                            startup, if that function is available on the sys‐
465                            tem.  This is useful for ensuring that signals de‐
466                            livered to a process that  is  executing  the  de‐
467                            buggee  are  not  propagated to the debuggee, e.g.
468                            when Ctrl-C sends SIGINT to the sdb tool.
469
470                     suspend=[y/n]
471                            Defaults to yes, with the default option Mono will
472                            suspend  the  vm on startup until it connects suc‐
473                            cessfully to a debugger front end.  If you set  it
474                            to 'n', in conjunction with server=y, it instructs
475                            the Mono runtime to run as normal,  while  caching
476                            metadata to send to the debugger front end on con‐
477                            nection..
478
479                     transport=transport_name
480                            This is used to specify the transport that the de‐
481                            bugger will use to communicate.   It must be spec‐
482                            ified  and   currently   requires   this   to   be
483                            'dt_socket'.
484
485              --desktop
486                     Configures  the  virtual  machine to be better suited for
487                     desktop applications.  Currently this sets the GC  system
488                     to  avoid  expanding  the heap as much as possible at the
489                     expense of slowing down garbage collection a bit.
490
491              --full-aot
492                     This flag instructs the Mono runtime to not generate  any
493                     code at runtime and depend exclusively on the code gener‐
494                     ated from using mono --aot=full previously.  This is use‐
495                     ful for platforms that do not permit dynamic code genera‐
496                     tion, or if you need to run  assemblies  that  have  been
497                     stripped  of  IL (for example using mono-cil-strip).  No‐
498                     tice that this feature will abort execution at runtime if
499                     a codepath in your program, or Mono's class libraries at‐
500                     tempts to generate code  dynamically.   You  should  test
501                     your  software  upfront and make sure that you do not use
502                     any dynamic features.
503
504              --full-aot-interp
505                     Same as --full-aot with fallback to the interpreter.
506
507              --gc=boehm, --gc=sgen
508                     Selects the Garbage Collector engine  for  Mono  to  use,
509                     Boehm  or  SGen.   Currently this merely ensures that you
510                     are  running  either  the  mono  or  mono-sgen  commands.
511                     This  flag can be set in the MONO_ENV_OPTIONS environment
512                     variable to force all of your child processes to use  one
513                     particular kind of GC with the Mono runtime.
514
515              --gc-debug=[options]
516                     Command  line equivalent of the MONO_GC_DEBUG environment
517                     variable.
518
519              --gc-params=[options]
520                     Command line equivalent of the MONO_GC_PARAMS environment
521                     variable.
522
523              --arch=32, --arch=64
524                     (Mac  OS  X only): Selects the bitness of the Mono binary
525                     used, if available. If the binary used is already for the
526                     selected  bitness, nothing changes. If not, the execution
527                     switches to a binary with the selected bitness suffix in‐
528                     stalled  side by side (for example, '/bin/mono --arch=64'
529                     will switch to '/bin/mono64' iff '/bin/mono' is a  32-bit
530                     build).
531
532              --help, -h
533                     Displays usage instructions.
534
535              --interpreter
536                     The  Mono  runtime  will use its interpreter to execute a
537                     given assembly.  The interpreter is usually  slower  than
538                     the  JIT,  but  it  can be useful on platforms where code
539                     generation at runtime is not allowed.
540
541              --hybrid-aot
542                     This flag allows the Mono runtime to run assemblies  that
543                     have  been  stripped  of  IL, for example using mono-cil-
544                     strip. For this to work, the assembly must have been  AOT
545                     compiled with --aot=hybrid.
546
547                     This  flag is similar to --full-aot, but it does not dis‐
548                     able the JIT. This means you  can  use  dynamic  features
549                     such as System.Reflection.Emit.
550
551              --llvm If  the  Mono runtime has been compiled with LLVM support
552                     (not available in all configurations), Mono will use  the
553                     LLVM  optimization  and  code generation engine to JIT or
554                     AOT   compile.    For    more    information,    consult:
555                     http://www.mono-project.com/docs/advanced/mono-llvm/
556
557              --ffast-math
558                     This flag allows Mono and LLVM to apply aggressive float‐
559                     ing point optimizations.  Can break IEEE754 compliance.
560
561              --nollvm
562                     When using a Mono that has been compiled with  LLVM  sup‐
563                     port,  it  forces  Mono to fallback to its JIT engine and
564                     not use the LLVM backend.
565
566              --optimize=MODE, -O=MODE
567                     MODE is a comma separated list  of  optimizations.   They
568                     also  allow  optimizations  to be turned off by prefixing
569                     the optimization name with a  minus  sign.   In  general,
570                     Mono  has been tuned to use the default set of flags, be‐
571                     fore using these flags  for  a  deployment  setting,  you
572                     might  want  to  actually  measure  the benefits of using
573                     them.  The following optimization flags  are  implemented
574                     in the core engine:
575                                  abcrem     Array bound checks removal
576                                  all        Turn on all optimizations
577                                  aot        Usage of Ahead Of Time compiled code
578                                  branch     Branch optimizations
579                                  cfold      Constant folding
580                                  cmov       Conditional moves [arch-dependency]
581                                  deadce     Dead code elimination
582                                  consprop   Constant propagation
583                                  copyprop   Copy propagation
584                                  fcmov      Fast x86 FP compares [arch-dependency]
585                                  float32     Perform 32-bit float arithmetic using 32-bit operations
586                                  gshared    Enable generic code sharing.
587                                  inline     Inline method calls
588                                  intrins    Intrinsic method implementations
589                                  linears    Linear scan global reg allocation
590                                  leaf       Leaf procedures optimizations
591                                  loop       Loop related optimizations
592                                  peephole   Peephole postpass
593                                  precomp    Precompile all methods before executing Main
594                                  sched      Instruction scheduling
595                                  shared     Emit per-domain code
596                                  sse2       SSE2 instructions on x86 [arch-dependency]
597                                  tailc      Tail recursion and tail calls
598                     For example, to enable all the optimization but dead code
599                     elimination and inlining, you can use:
600                          -O=all,-deadce,-inline
601                     The flags that are flagged with  [arch-dependency]  indi‐
602                     cate  that  the  given option if used in combination with
603                     Ahead of Time compilation (--aot flag) would produce pre-
604                     compiled  code  that  will  depend on the current CPU and
605                     might not be safely moved to another computer.
606
607                     The following optimizations are supported
608
609                     float32
610                            Requests that the runtime performn 32-bit floating
611                            point  operations using only 32-bits.   By default
612                            the Mono runtime tries to use the  highest  preci‐
613                            sion  available for floating point operations, but
614                            while this might render better results,  the  code
615                            might  run slower.   This options also affects the
616                            code generated by the LLVM backend.
617
618                     inline Controls whether the runtime should attempt to in‐
619                            line  (the default), or not inline methods invoca‐
620                            tions
621              --response=FILE Provides a response  file,  this  instructs  the
622              Mono  command to read other command line options from the speci‐
623              fied file, as if the options had been specified on  the  command
624              line.   Useful when you have very long command lines.
625
626              --runtime=VERSION
627                     Mono  supports  different  runtime  versions. The version
628                     used depends on the program that is being run or  on  its
629                     configuration  file  (named program.exe.config). This op‐
630                     tion can be used to override such autodetection, by forc‐
631                     ing  a  different  runtime  version to be used. Note that
632                     this should only be used to  select  a  later  compatible
633                     runtime  version  than  the  one the program was compiled
634                     against. A typical usage is for running a 1.1 program  on
635                     a 2.0 version:
636                              mono --runtime=v2.0.50727 program.exe
637
638              --server
639                     Configures  the  virtual  machine to be better suited for
640                     server operations (currently, allows a heavier threadpool
641                     initialization).
642
643              --use-map-jit
644                     Instructs  Mono  to generate code using MAP_JIT on MacOS.
645                     Necessary for bundled applications.
646
647              --verify-all
648                     Verifies mscorlib and assemblies in the  global  assembly
649                     cache  for valid IL, and all user code for IL verifiabil‐
650                     ity.
651
652                     This is different from --security's verifiable or validil
653                     in  that  these  options  only  check  user code and skip
654                     mscorlib and assemblies located on  the  global  assembly
655                     cache.
656
657              -V, --version
658                     Prints JIT version information (system configuration, re‐
659                     lease number and branch names if available).
660
661              --version=number
662                     Print version number only.
663
664
665

DEVELOPMENT OPTIONS

667       The following options are used to help when developing a JITed applica‐
668       tion.
669
670       --debug, --debug=OPTIONS
671              Turns  on the debugging mode in the runtime.  If an assembly was
672              compiled with debugging information, it will produce line number
673              information for stack traces.
674
675              The  optional  OPTIONS argument is a comma separated list of de‐
676              bugging options.  These options are turned off by default  since
677              they generate much larger and slower code at runtime.
678
679              The following options are supported:
680
681              casts  Produces  a detailed error when throwing a InvalidCastEx‐
682                     ception.   This option needs to be enabled as this gener‐
683                     ates more verbose code at execution time.
684
685              mdb-optimizations
686                     Disable  some  JIT  optimizations  which are usually only
687                     disabled when running inside the debugger.  This  can  be
688                     helpful if you want to attach to the running process with
689                     mdb.
690
691              gdb    Generate and register  debugging  information  with  gdb.
692                     This  is  only supported on some platforms, and only when
693                     using gdb 7.0 or later.
694
695       --profile[=profiler[:profiler_args]]
696              Loads a profiler module with the given arguments. For  more  in‐
697              formation,  see  the PROFILING section.  This option can be used
698              multiple times; each time will load an additional profiler  mod‐
699              ule.
700
701       --trace[=expression]
702              Shows  method names as they are invoked.  By default all methods
703              are traced.  The trace can be customized to include  or  exclude
704              methods,  classes  or assemblies.  A trace expression is a comma
705              separated list of targets, each target can be  prefixed  with  a
706              minus  sign  to  turn  off a particular target.  The words `pro‐
707              gram', `all' and `disabled'  have  special  meaning.   `program'
708              refers  to  the main program being executed, and `all' means all
709              the method calls.  The `disabled' option is  used  to  start  up
710              with  tracing  disabled.   It can be enabled at a later point in
711              time in the program by sending the SIGUSR2 signal  to  the  run‐
712              time.   Assemblies  are specified by their name, for example, to
713              trace all calls in the System assembly, use:
714
715                   mono --trace=System app.exe
716
717              Classes are specified with the T: prefix.  For example, to trace
718              all calls to the System.String class, use:
719
720                   mono --trace=T:System.String app.exe
721
722              And  individual  methods  are referenced with the M: prefix, and
723              the standard method notation:
724
725                   mono --trace=M:System.Console:WriteLine app.exe
726
727              Exceptions can also be traced, it will cause a stack trace to be
728              printed every time an exception of the specified type is thrown.
729              The exception type can be specified with or  without  the  name‐
730              space,  and  to  trace all exceptions, specify 'all' as the type
731              name.
732
733                   mono --trace=E:System.Exception app.exe
734
735              As previously noted, various rules can be specified at once:
736
737                   mono --trace=T:System.String,T:System.Random app.exe
738
739              You can exclude pieces, the next example traces  calls  to  Sys‐
740              tem.String except for the System.String:Concat method.
741
742                   mono --trace=T:System.String,-M:System.String:Concat
743
744              You can trace managed to unmanaged transitions using the wrapper
745              qualifier:
746
747                   mono --trace=wrapper app.exe
748
749              Finally, namespaces can be specified using the N: prefix:
750
751                   mono --trace=N:System.Xml
752
753
754       --no-x86-stack-align
755              Don't align stack frames on the x86 architecture.   By  default,
756              Mono  aligns  stack  frames  to  16  bytes on x86, so that local
757              floating point and SIMD variables can be properly aligned.  This
758              option turns off the alignment, which usually saves one instruc‐
759              tion per call, but might result in significantly lower  floating
760              point and SIMD performance.
761
762       --jitmap
763              Generate a JIT method map in a /tmp/perf-PID.map file. This file
764              is then used, for example, by the perf tool included  in  recent
765              Linux kernels.  Each line in the file has:
766
767                   HEXADDR HEXSIZE methodname
768
769              Currently this option is only supported on Linux.
770

JIT MAINTAINER OPTIONS

772       The  maintainer  options  are only used by those developing the runtime
773       itself, and not typically of interest to runtime users or developers.
774
775       --bisect=optimization:filename
776              This flag is used by the automatic  optimization  bug  bisector.
777              It  takes an optimization flag and a filename of a file contain‐
778              ing a list of full method names, one per line.  When it compiles
779              one  of  the  methods  in  the file it will use the optimization
780              given, in addition to the optimizations that are  otherwise  en‐
781              abled.  Note that if the optimization is enabled by default, you
782              should disable it with `-O`, otherwise it will just apply to ev‐
783              ery method, whether it's in the file or not.
784
785       --break method
786              Inserts  a  breakpoint  before the method whose name is `method'
787              (namespace.class:methodname).  Use `Main' as method name to  in‐
788              sert a breakpoint on the application's main method.  You can use
789              it   also   with   generics,   for    example    "System.Collec‐
790              tions.Generic.Queue`1:Peek"
791
792       --breakonex
793              Inserts  a  breakpoint  on exceptions.  This allows you to debug
794              your application with a native debugger  when  an  exception  is
795              thrown.
796
797       --compile name
798              This compiles a method (namespace.name:methodname), this is used
799              for testing the compiler performance or to examine the output of
800              the code generator.
801
802       --compile-all
803              Compiles  all  the methods in an assembly.  This is used to test
804              the compiler performance or to examine the output  of  the  code
805              generator
806
807       --graph=TYPE METHOD
808              This  generates  a postscript file with a graph with the details
809              about the specified  method  (namespace.name:methodname).   This
810              requires  `dot' and ghostview to be installed (it expects Ghost‐
811              view to be called "gv").  The following graphs are available:
812                        cfg        Control Flow Graph (CFG)
813                        dtree      Dominator Tree
814                        code       CFG showing code
815                        ssa        CFG showing code after SSA translation
816                        optcode    CFG showing code after IR optimizations
817              Some graphs will only be available if certain optimizations  are
818              turned on.
819
820       --ncompile
821              Instruct  the  runtime  on  the  number of times that the method
822              specified by --compile (or all the methods if  --compile-all  is
823              used) to be compiled.  This is used for testing the code genera‐
824              tor performance.
825
826       --stats=[method]
827              Displays information about the work done by the  runtime  during
828              the   execution   of   an   application.   If  a  method  (name‐
829              space.name:methodname) is specified, it will display that infor‐
830              mation  when  the  method is first run in addition to the end of
831              program execution.
832
833       --wapi=hps|semdel
834              Perform maintenance of the process  shared  data.   semdel  will
835              delete  the  global semaphore.  hps will list the currently used
836              handles.
837
838       -v, --verbose
839              Increases the verbosity level, each time it is listed, increases
840              the  verbosity level to include more information (including, for
841              example, a disassembly of the native code produced, code  selec‐
842              tor info etc.).
843

ATTACH SUPPORT

845       The  Mono  runtime  allows  external  processes  to attach to a running
846       process and load assemblies into the running program.    To  attach  to
847       the  process,  a special protocol is implemented in the Mono.Management
848       assembly.
849
850       With this support it is possible to load assemblies that have an  entry
851       point  (they  are  created  with  -target:exe  or -target:winexe) to be
852       loaded and executed in the Mono process.
853
854       The code is loaded into the root domain, and it starts execution on the
855       special  runtime  attach  thread.    The attached program should create
856       its own threads and return after invocation.
857
858       This support allows for example debugging applications  by  having  the
859       csharp shell attach to running processes.
860

PROFILING

862       The  Mono  runtime includes a profiler API that dynamically loaded pro‐
863       filer modules and embedders can use to collect performance-related data
864       about an application. Profiler modules are loaded by passing the --pro‐
865       file command line argument to the Mono runtime.
866
867       Mono ships with a few profiler modules, of which the  log  profiler  is
868       the  most feature-rich. It is also the default profiler if the profiler
869       argument is not given, or if default is given.  It is possible to write
870       your own profiler modules; see the Custom profilers sub-section.
871
872   Log profiler
873       The  log  profiler  can be used to collect a lot of information about a
874       program running in the Mono runtime. This data can be used (both  while
875       the  process is running and later) to do analyses of the program behav‐
876       ior, determine resource usage, performance issues or even look for par‐
877       ticular execution patterns.
878
879       This is accomplished by logging the events provided by the Mono runtime
880       through the profiler API and periodically writing them to a file  which
881       can later be inspected with the mprof-report(1) tool.
882
883       More  information about how to use the log profiler is available on the
884       mono-profilers(1) page, under the LOG PROFILER section, as well as  the
885       mprof-report(1) page.
886
887   Coverage profiler
888       The  code  coverage profiler can instrument a program to help determine
889       which classes, methods, code paths, etc are actually executed. This  is
890       most  useful  when  running a test suite to determine whether the tests
891       actually cover the code they're expected to.
892
893       More information about how to use the coverage profiler is available on
894       the mono-profilers(1) page, under the COVERAGE PROFILER section.
895
896   AOT profiler
897       The  AOT profiler can help improve startup performance by logging which
898       generic instantiations are used by a program, which  the  AOT  compiler
899       can then use to compile those instantiations ahead of time so that they
900       won't have to be JIT compiled at startup.
901
902       More information about how to use the AOT profiler is available on  the
903       mono-profilers(1) page, under the AOT PROFILER section.
904
905   Custom profilers
906       Custom  profiler  modules  can be loaded in exactly the same way as the
907       standard modules that ship with Mono. They can  also  access  the  same
908       profiler  API  to  gather all kinds of information about the code being
909       executed.
910
911       For example, to use a third-party profiler  called  custom,  you  would
912       load it like this:
913
914              mono --profile=custom program.exe
915
916       You could also pass arguments to it:
917
918              mono --profile=custom:arg1,arg2=arg3 program.exe
919
920       In  the  above example, Mono will load the profiler from the shared li‐
921       brary called libmono-profiler-custom.so (name varies based on platform,
922       e.g.,  libmono-profiler-custom.dylib  on  OS  X).  This profiler module
923       must be on your dynamic linker library path  (LD_LIBRARY_PATH  on  most
924       systems, DYLD_LIBRARY_PATH on OS X).
925
926       For a sample of how to write your own custom profiler, look at the sam‐
927       ples/profiler/sample.c file in the Mono source tree.
928

DEBUGGING AIDS

930       To debug managed applications, you can use the mdb command,  a  command
931       line debugger.
932
933       It  is  possible  to  obtain a stack trace of all the active threads in
934       Mono by sending the QUIT signal to Mono, you can do this from the  com‐
935       mand line, like this:
936
937            kill -QUIT pid
938
939       Where  pid  is  the Process ID of the Mono process you want to examine.
940       The process will continue running afterwards,  but  its  state  is  not
941       guaranteed.
942
943       Important:  this  is a last-resort mechanism for debugging applications
944       and should not be used to monitor or probe  a  production  application.
945       The  integrity  of the runtime after sending this signal is not guaran‐
946       teed and the application might crash or terminate at  any  given  point
947       afterwards.
948
949       The  --debug=casts  option can be used to get more detailed information
950       for Invalid Cast operations, it  will  provide  information  about  the
951       types involved.
952
953       You  can use the MONO_LOG_LEVEL and MONO_LOG_MASK environment variables
954       to get verbose debugging output about the execution of your application
955       within Mono.
956
957       The  MONO_LOG_LEVEL  environment  variable if set, the logging level is
958       changed to the set value.  Possible  values  are  "error",  "critical",
959       "warning",  "message",  "info",  "debug". The default value is "error".
960       Messages with a logging level greater then or equal to  the  log  level
961       will be printed to stdout/stderr.
962
963       Use "info" to track the dynamic loading of assemblies.
964
965       Use  the  MONO_LOG_MASK environment variable to limit the extent of the
966       messages you get: If set, the log mask is changed  to  the  set  value.
967       Possible  values are "asm" (assembly loader), "type", "dll" (native li‐
968       brary loader), "gc" (garbage collector), "cfg"  (config  file  loader),
969       "aot"  (precompiler),  "security"  (e.g.  Moonlight  CoreCLR  support),
970       "threadpool" (thread pool generic), "io-selector" (async socket  opera‐
971       tions), "io-layer" (I/O layer - processes, files, sockets, events, sem‐
972       aphores, mutexes  and  handles),  "io-layer-process",  "io-layer-file",
973       "io-layer-socket",  "io-layer-event",  "io-layer-semaphore", "io-layer-
974       mutex", "io-layer-handle" and  "all".   The  default  value  is  "all".
975       Changing  the mask value allows you to display only messages for a cer‐
976       tain component. You can use multiple masks by  comma  separating  them.
977       For  example  to  see config file messages and assembly loader messages
978       set you mask to "asm,cfg".
979
980       The following is a common use to track down problems with P/Invoke:
981
982            $ MONO_LOG_LEVEL="debug" MONO_LOG_MASK="dll" mono glue.exe
983
984

DEBUGGING WITH LLDB

986       If you are using LLDB, you can use the mono.py script to print some in‐
987       ternal  data  structures  with  it.    To  use  this,  add this to your
988       $HOME/.lldbinit file:
989       command script import $PREFIX/lib/mono/lldb/mono.py
990
991       Where $PREFIX is the prefix value that you  used  when  you  configured
992       Mono (typically /usr).
993
994       Once  this  is done, then you can inspect some Mono Runtime data struc‐
995       tures, for example:
996       (lldb) p method
997
998       (MonoMethod *) $0 = 0x05026ac0 [mscorlib]System.OutOfMemoryException:.ctor()
999

SERIALIZATION

1001       Mono's XML serialization engine by default will use a  reflection-based
1002       approach  to  serialize  which  might be slow for continuous processing
1003       (web service applications).  The serialization  engine  will  determine
1004       when a class must use a hand-tuned serializer based on a few parameters
1005       and if needed it will produce a customized C# serializer for your types
1006       at  runtime.   This  customized serializer then gets dynamically loaded
1007       into your application.
1008
1009       You can control this with the MONO_XMLSERIALIZER_THS environment  vari‐
1010       able.
1011
1012       The  possible values are `no' to disable the use of a C# customized se‐
1013       rializer, or an integer that is the minimum number of uses  before  the
1014       runtime will produce a custom serializer (0 will produce a custom seri‐
1015       alizer on the first access, 50 will produce a serializer  on  the  50th
1016       use). Mono will fallback to an interpreted serializer if the serializer
1017       generation somehow fails. This behavior can be disabled by setting  the
1018       option `nofallback' (for example: MONO_XMLSERIALIZER_THS=0,nofallback).
1019

ENVIRONMENT VARIABLES

1021       GC_DONT_GC
1022              Turns  off  the garbage collection in Mono.  This should be only
1023              used for debugging purposes
1024
1025       HTTP_PROXY
1026              (Also http_proxy) If set, web requests using the Mono Class  Li‐
1027              brary  will be automatically proxied through the given URL.  Not
1028              supported on Windows, Mac OS, iOS or Android. See also NO_PROXY.
1029
1030       LLVM_COUNT
1031              When Mono is compiled with LLVM support, this instructs the run‐
1032              time  to  stop  using LLVM after the specified number of methods
1033              are JITed.  This is a tool used in diagnostics to  help  isolate
1034              problems   in   the   code  generation  backend.    For  example
1035              LLVM_COUNT=10 would only compile 10 methods with LLVM  and  then
1036              switch  to  the Mono JIT engine.  LLVM_COUNT=0 would disable the
1037              LLVM engine altogether.
1038
1039       MONO_ASPNET_INHIBIT_SETTINGSMAP
1040              Mono contains a feature which allows modifying settings  in  the
1041              .config files shipped with Mono by using config section mappers.
1042              The mappers and the mapping  rules  are  defined  in  the  $pre‐
1043              fix/etc/mono/2.0/settings.map  file and, optionally, in the set‐
1044              tings.map file found in the top-level directory of your  ASP.NET
1045              application.   Both  files are read by System.Web on application
1046              startup, if they are found at the above locations. If you  don't
1047              want  the  mapping  to be performed you can set this variable in
1048              your environment before starting the application and  no  action
1049              will be taken.
1050
1051       MONO_ASPNET_WEBCONFIG_CACHESIZE
1052              Mono  has  a cache of ConfigSection objects for speeding up Web‐
1053              ConfigurationManager queries. Its default size is 100 items, and
1054              when  more items are needed, cache evictions start happening. If
1055              evictions are too frequent this could impose  unnecessary  over‐
1056              head,  which could be avoided by using this environment variable
1057              to set up a higher cache size (or to lower  memory  requirements
1058              by decreasing it).
1059
1060       MONO_CAIRO_DEBUG_DISPOSE
1061              If  set,  causes Mono.Cairo to collect stack traces when objects
1062              are allocated, so that the finalization/Dispose warnings include
1063              information about the instance's origin.
1064
1065       MONO_CFG_DIR
1066              If set, this variable overrides the default system configuration
1067              directory ($PREFIX/etc).  It's  used  to  locate  machine.config
1068              file.
1069
1070       MONO_COM
1071              Sets the style of COM interop.  If the value of this variable is
1072              "MS" Mono will use string  marhsalling  routines  from  the  li‐
1073              boleaut32  for  the BSTR type library, any other values will use
1074              the mono-builtin BSTR string marshalling.
1075
1076       MONO_CONFIG
1077              If set, this variable overrides the default  runtime  configura‐
1078              tion  file  ($PREFIX/etc/mono/config). The --config command line
1079              options overrides the environment variable.
1080
1081       MONO_CPU_ARCH
1082              Override the automatic cpu detection mechanism.  Currently  used
1083              only on arm.  The format of the value is as follows:
1084
1085                   "armvV [thumb[2]]"
1086
1087              where  V  is  the architecture number 4, 5, 6, 7 and the options
1088              can be currently be "thumb" or "thumb2". Example:
1089
1090                   MONO_CPU_ARCH="armv4 thumb" mono ...
1091
1092
1093       MONO_ARM_FORCE_SOFT_FLOAT
1094              When Mono is built with a soft float fallback on  ARM  and  this
1095              variable  is  set to "1", Mono will always emit soft float code,
1096              even if a VFP unit is detected.
1097
1098       MONO_DARWIN_USE_KQUEUE_FSW
1099              Fall back on the kqueue FileSystemWatcher implementation in Dar‐
1100              win. The default is the FSEvent implementation.
1101
1102       MONO_DARWIN_WATCHER_MAXFDS
1103              This  is  a  debugging  aid  used  to force limits on the kqueue
1104              FileSystemWatcher implementation in Darwin.   There is no  limit
1105              by default.
1106
1107       MONO_DISABLE_MANAGED_COLLATION
1108              If  this  environment variable is `yes', the runtime uses unman‐
1109              aged collation (which actually means no culture-sensitive colla‐
1110              tion).  It  internally  disables managed collation functionality
1111              invoked  via  the  members  of  System.Globalization.CompareInfo
1112              class. Collation is enabled by default.
1113
1114       MONO_DISABLE_SHARED_AREA
1115              Unix  only:  If set, disable usage of shared memory for exposing
1116              performance counters. This means it will not be possible to both
1117              externally read performance counters from this processes or read
1118              those of external processes.
1119
1120       MONO_DNS
1121              When set, enables the use of a fully managed  DNS  resolver  in‐
1122              stead of the regular libc functions. This resolver performs much
1123              better when multiple queries are run in parallel.
1124
1125              Note that /etc/nsswitch.conf will be ignored.
1126
1127       MONO_EGD_SOCKET
1128              For platforms that do not otherwise have a way of obtaining ran‐
1129              dom bytes this can be set to the name of a file system socket on
1130              which an egd or prngd daemon is listening.
1131
1132       MONO_ENABLE_AIO
1133              If set, tells mono to attempt using native asynchronous I/O ser‐
1134              vices. If not set, a default select/poll implementation is used.
1135              Currently epoll and kqueue are supported.
1136
1137       MONO_THREADS_SUSPEND Selects a mechanism that Mono will use to suspend
1138              threads.  May be  set  to  "preemptive",  "coop",  or  "hybrid".
1139              Threads  may need to be suspended by the debugger, or using some
1140              .NET threading APIs, and most commonly  when  the  SGen  garbage
1141              collector  needs  to stop all threads during a critical phase of
1142              garbage collection.  Preemptive mode is the mode that  Mono  has
1143              used  historically,  going  back  to  the  Boehm days, where the
1144              garbage collector would run at any point and  suspend  execution
1145              of all threads as required to perform a garbage collection.  The
1146              cooperative mode on the other hand requires the  cooperation  of
1147              all  threads  to stop at a safe point.  This makes for an easier
1148              to debug garbage collector and it improves the stability of  the
1149              runtime  because threads are not suspended when accessing criti‐
1150              cal resources.  In scenarios where Mono is embedded  in  another
1151              application,  cooperative  suspend requires the embedder code to
1152              follow coding guidelines in order to cooperate with the  garbage
1153              collector.   Cooperative  suspend  in embedded Mono is currently
1154              experimental.  Hybrid mode is a combination of the two that  re‐
1155              tains better compatability with scenarios where Mono is embedded
1156              in another application: threads that are running managed code or
1157              code  that comprises the Mono runtime will be cooperatively sus‐
1158              pended, while threads running embedder code will be preemptively
1159              suspended.   Hybrid suspend is the default on some desktop plat‐
1160              forms.
1161
1162              Alternatively, coop and hybrid mode can be  enabled  at  compile
1163              time  by  using the --enable-cooperative-suspend or --enable-hy‐
1164              brid-suspend flags, respectively, when calling  configure.   The
1165              MONO_THREADS_SUSPEND  environment  variable  takes priority over
1166              the compiled default.
1167
1168       MONO_ENABLE_COOP_SUSPEND
1169              This environment variable is obsolete, but retained for backward
1170              compatibility.   Use MONO_THREADS_SUSPEND set to "coop" instead.
1171              Note that if configure flags were provided to enable cooperative
1172              or hybrid suspend, this variable is ignored.
1173
1174       MONO_ENV_OPTIONS
1175              This  environment variable allows you to pass command line argu‐
1176              ments to a Mono process through the environment.   This is  use‐
1177              ful  for example to force all of your Mono processes to use LLVM
1178              or SGEN without having to modify any launch scripts.
1179
1180       MONO_SDB_ENV_OPTIONS
1181              Used to pass extra options to the debugger agent in the runtime,
1182              as they were passed using --debugger-agent=.
1183
1184       MONO_EVENTLOG_TYPE
1185              Sets  the type of event log provider to use (for System.Diagnos‐
1186              tics.EventLog).  Possible values are:
1187
1188              local[:path]
1189                     Persists event logs and entries to the local file system.
1190                     The  directory  in which to persist the event logs, event
1191                     sources and entries can  be  specified  as  part  of  the
1192                     value.  If the path is not explicitly set, it defaults to
1193                     "/var/lib/mono/eventlog" on unix  and  "%APPDATA%no\vent‐
1194                     log" on Windows.
1195
1196              win32  Uses  the  native win32 API to write events and registers
1197                     event logs and event sources in the registry.    This  is
1198                     only  available  on Windows.  On Unix, the directory per‐
1199                     mission for individual event log and event source  direc‐
1200                     tories  is  set to 777 (with +t bit) allowing everyone to
1201                     read and write event log entries while only allowing  en‐
1202                     tries to be deleted by the user(s) that created them.
1203
1204              null   Silently discards any events.
1205
1206              The  default  is  "null" on Unix (and versions of Windows before
1207              NT), and "win32" on Windows NT (and higher).
1208
1209       MONO_EXTERNAL_ENCODINGS
1210              If set, contains a colon-separated list of text encodings to try
1211              when  turning externally-generated text (e.g. command-line argu‐
1212              ments or filenames) into Unicode.  The encoding names come  from
1213              the  list  provided  by iconv, and the special case "default_lo‐
1214              cale" which refers to the current locale's default encoding.
1215
1216              When reading externally-generated text strings  UTF-8  is  tried
1217              first,  and then this list is tried in order with the first suc‐
1218              cessful conversion ending the  search.   When  writing  external
1219              text  (e.g.  new  filenames  or  arguments to new processes) the
1220              first item in this list is used, or  UTF-8  if  the  environment
1221              variable is not set.
1222
1223              The  problem  with using MONO_EXTERNAL_ENCODINGS to process your
1224              files is that it results in a problem: although its possible  to
1225              get  the  right file name it is not necessarily possible to open
1226              the file.  In general if you have  problems  with  encodings  in
1227              your filenames you should use the "convmv" program.
1228
1229       MONO_GC_PARAMS
1230              When  using  Mono  with the SGen garbage collector this variable
1231              controls several parameters of the  collector.   The  variable's
1232              value is a comma separated list of words.
1233
1234              max-heap-size=size
1235                     Sets  the maximum size of the heap. The size is specified
1236                     in bytes and must be a power of two.  The  suffixes  `k',
1237                     `m' and `g' can be used to specify kilo-, mega- and giga‐
1238                     bytes, respectively. The limit is the sum of the nursery,
1239                     major  heap  and  large  object  heap.  Once the limit is
1240                     reached the application  will  receive  OutOfMemoryExcep‐
1241                     tions  when  trying  to allocate.  Not the full extent of
1242                     memory set in max-heap-size could be available to satisfy
1243                     a single allocation due to internal fragmentation. By de‐
1244                     fault heap limits is disabled and the GC will try to  use
1245                     all available memory.
1246
1247              nursery-size=size
1248                     Sets  the  size of the nursery.  The size is specified in
1249                     bytes and must be a power of two.  The suffixes `k',  `m'
1250                     and  `g'  can  be  used to specify kilo-, mega- and giga‐
1251                     bytes, respectively.  The nursery is the first generation
1252                     (of  two).   A  larger  nursery will usually speed up the
1253                     program but will obviously use more memory.  The  default
1254                     nursery size 4 MB.
1255
1256              major=collector
1257                     Specifies  which  major  collector  to  use.  Options are
1258                     `marksweep' for  the  Mark&Sweep  collector,  `marksweep-
1259                     conc'  for concurrent Mark&Sweep and `marksweep-conc-par'
1260                     for parallel and concurrent Mark&Sweep.   The  concurrent
1261                     Mark&Sweep collector is the default.
1262
1263              mode=balanced|throughput|pause[:max-pause]
1264                     Specifies  what should be the garbage collector's target.
1265                     The `throughput' mode aims to reduce time  spent  in  the
1266                     garbage  collector  and  improve  application  speed, the
1267                     `pause' mode aims to keep pause times to a minimum and it
1268                     receives the argument max-pause which specifies the maxi‐
1269                     mum pause time in milliseconds that is acceptable and the
1270                     `balanced' mode which is a general purpose optimal mode.
1271
1272              soft-heap-limit=size
1273                     Once  the  heap  size  gets larger than this size, ignore
1274                     what the default major collection trigger metric says and
1275                     only  allow  four nursery size's of major heap growth be‐
1276                     tween major collections.
1277
1278              evacuation-threshold=threshold
1279                     Sets the evacuation threshold in percent.  This option is
1280                     only  available  on the Mark&Sweep major collectors.  The
1281                     value must be an integer in the range 0 to 100.  The  de‐
1282                     fault  is 66.  If the sweep phase of the collection finds
1283                     that the occupancy of a specific heap block type is  less
1284                     than this percentage, it will do a copying collection for
1285                     that block type in the  next  major  collection,  thereby
1286                     restoring  occupancy to close to 100 percent.  A value of
1287                     0 turns evacuation off.
1288
1289              (no-)lazy-sweep
1290                     Enables or disables lazy sweep for the Mark&Sweep collec‐
1291                     tor.   If  enabled, the sweeping of individual major heap
1292                     blocks is done piecemeal whenever the need arises,  typi‐
1293                     cally  during  nursery collections.  Lazy sweeping is en‐
1294                     abled by default.
1295
1296              (no-)concurrent-sweep
1297                     Enables or disables concurrent sweep for  the  Mark&Sweep
1298                     collector.  If enabled, the iteration of all major blocks
1299                     to determine which ones can be freed and which ones  have
1300                     to  be kept and swept, is done concurrently with the run‐
1301                     ning program.  Concurrent sweeping is enabled by default.
1302
1303              stack-mark=mark-mode
1304                     Specifies how application threads should be scanned.  Op‐
1305                     tions  are  `precise` and `conservative`. Precise marking
1306                     allow the collector to know what values on stack are ref‐
1307                     erences  and  what are not.  Conservative marking threats
1308                     all values as potentially references and leave  them  un‐
1309                     touched. Precise marking reduces floating garbage and can
1310                     speed up nursery collection and allocation rate,  it  has
1311                     the  downside of requiring a significant extra memory per
1312                     compiled method. The  right  option,  unfortunately,  re‐
1313                     quires experimentation.
1314
1315              save-target-ratio=ratio
1316                     Specifies  the target save ratio for the major collector.
1317                     The collector lets a given amount of memory  to  be  pro‐
1318                     moted from the nursery due to minor collections before it
1319                     triggers a major collection. This amount is based on  how
1320                     much  memory  it  expects to free. It is represented as a
1321                     ratio of the size of the heap after a  major  collection.
1322                     Valid values are between 0.1 and 2.0. The default is 0.5.
1323                     Smaller values will keep the major heap size smaller  but
1324                     will  trigger  more  major  collections. Likewise, bigger
1325                     values will use more memory and result in  less  frequent
1326                     major  collections.   This  option is EXPERIMENTAL, so it
1327                     might disappear in later versions of mono.
1328
1329              default-allowance-ratio=ratio
1330                     Specifies the default allocation allowance when the  cal‐
1331                     culated  size  is  too small. The allocation allowance is
1332                     how much memory the  collector  let  be  promoted  before
1333                     triggered a major collection.  It is a ratio of the nurs‐
1334                     ery size.  Valid values are between 1.0 and 10.0. The de‐
1335                     fault  is  4.0.  Smaller values lead to smaller heaps and
1336                     more frequent major collections.  Likewise, bigger values
1337                     will  allow  the  heap to grow faster but use more memory
1338                     when it reaches a stable size.  This option is EXPERIMEN‐
1339                     TAL, so it might disappear in later versions of mono.
1340
1341              minor=minor-collector
1342                     Specifies which minor collector to use. Options are `sim‐
1343                     ple' which promotes all objects from the nursery directly
1344                     to the old generation, `simple-par' which has same promo‐
1345                     tion behavior as `simple' but using multiple workers  and
1346                     `split' which lets objects stay longer on the nursery be‐
1347                     fore promoting.
1348
1349              alloc-ratio=ratio
1350                     Specifies the ratio of memory from the nursery to be  use
1351                     by  the alloc space.  This only can only be used with the
1352                     split minor collector.  Valid values are integers between
1353                     1 and 100. Default is 60.
1354
1355              promotion-age=age
1356                     Specifies the required age of an object must reach inside
1357                     the nursery before been promoted to the  old  generation.
1358                     This  only  can only be used with the split minor collec‐
1359                     tor.  Valid values are integers between 1 and 14. Default
1360                     is 2.
1361
1362              (no-)cementing
1363                     Enables  or  disables  cementing.   This can dramatically
1364                     shorten nursery collection times on some benchmarks where
1365                     pinned objects are referred to from the major heap.
1366
1367              allow-synchronous-major
1368                     This forbids the major collector from performing synchro‐
1369                     nous major collections.  The major collector  might  want
1370                     to  do a synchronous collection due to excessive fragmen‐
1371                     tation. Disabling this might trigger OutOfMemory error in
1372                     situations that would otherwise not happen.
1373
1374       MONO_GC_DEBUG
1375              When using Mono with the SGen garbage collector this environment
1376              variable can be used to turn on various  debugging  features  of
1377              the  collector.  The value of this variable is a comma separated
1378              list of words.  Do not use these options in production.
1379
1380              number Sets the debug level to the specified number.
1381
1382              print-allowance
1383                     After each major collection prints memory consumption for
1384                     before and after the collection and the allowance for the
1385                     minor collector, i.e. how much the  heap  is  allowed  to
1386                     grow from minor collections before the next major collec‐
1387                     tion is triggered.
1388
1389              print-pinning
1390                     Gathers statistics  on  the  classes  whose  objects  are
1391                     pinned in the nursery and for which global remset entries
1392                     are added.  Prints those statistics when shutting down.
1393
1394              collect-before-allocs
1395
1396              check-remset-consistency
1397                     This performs a remset consistency check at  various  op‐
1398                     portunities,  and  also  clears the nursery at collection
1399                     time, instead of the default, when buffers are  allocated
1400                     (clear-at-gc).   The consistency check ensures that there
1401                     are no major to minor references that are not on the  re‐
1402                     membered sets.
1403
1404              mod-union-consistency-check
1405                     Checks  that the mod-union cardtable is consistent before
1406                     each finishing major collection  pause.   This  check  is
1407                     only applicable to concurrent major collectors.
1408
1409              check-mark-bits
1410                     Checks that mark bits in the major heap are consistent at
1411                     the end of each major collection.  Consistent  mark  bits
1412                     mean that if an object is marked, all objects that it had
1413                     references to must also be marked.
1414
1415              check-nursery-untag
1416                     After  garbage  collections,  check  whether  all  vtable
1417                     pointers are no longer tagged.
1418
1419              xdomain-checks
1420                     Performs a check to make sure that no references are left
1421                     to an unloaded AppDomain.
1422
1423              clear-at-tlab-creation
1424                     Clears the nursery incrementally when  the  thread  local
1425                     allocation  buffers (TLAB) are created.  The default set‐
1426                     ting clears the whole nursery at GC time.
1427
1428              debug-clear-at-tlab-creation
1429                     Clears the nursery incrementally when  the  thread  local
1430                     allocation  buffers  (TLAB)  are  created, but at GC time
1431                     fills it with the byte `0xff`, which should result  in  a
1432                     crash  more  quickly  if `clear-at-tlab-creation` doesn't
1433                     work properly.
1434
1435              clear-at-gc
1436                     This clears the nursery at GC time instead  of  doing  it
1437                     when  the  thread  local allocation buffer (TLAB) is cre‐
1438                     ated.  The default is to clear the nursery at  TLAB  cre‐
1439                     ation time.
1440
1441              disable-minor
1442                     Don't  do  minor  collections.  If the nursery is full, a
1443                     major collection is triggered instead, unless it, too, is
1444                     disabled.
1445
1446              disable-major
1447                     Don't do major collections.
1448
1449              conservative-stack-mark
1450                     Forces  the  GC to scan the stack conservatively, even if
1451                     precise scanning is available.
1452
1453              no-managed-allocator
1454                     Disables the managed allocator.
1455
1456              managed-allocator
1457                     Enables the managed allocator.
1458
1459              check-scan-starts
1460                     If set, does a plausibility check on the scan_starts  be‐
1461                     fore and after each collection
1462
1463              verify-nursery-at-minor-gc
1464                     If set, does a complete object walk of the nursery at the
1465                     start of each minor collection.
1466
1467              dump-nursery-at-minor-gc
1468                     If set, dumps the contents of the nursery at the start of
1469                     each  minor collection. Requires verify-nursery-at-minor-
1470                     gc to be set.
1471
1472              heap-dump=file
1473                     Dumps the heap contents to the specified file.   To visu‐
1474                     alize the information, use the mono-heapviz tool.
1475
1476              binary-protocol=file
1477                     Outputs the debugging output to the specified file.   For
1478                     this to work, Mono needs to  be  compiled  with  the  BI‐
1479                     NARY_PROTOCOL  define  on  sgen-gc.c.    You can then use
1480                     this command to explore the output
1481                                     sgen-grep-binprot 0x1234 0x5678 < file
1482
1483              nursery-canaries
1484                     If set, objects allocated in  the  nursery  are  suffixed
1485                     with  a canary (guard) word, which is checked on each mi‐
1486                     nor collection. Can be used to detect/debug heap  corrup‐
1487                     tion issues. This disables the usage of the managed allo‐
1488                     cator, because allocation from full aot code is inconsis‐
1489                     tent  with  this option. If the application is guaranteed
1490                     not to use aot code, the managed allocator can be enabled
1491                     back with managed-allocator option.
1492
1493
1494              do-not-finalize(=classes)
1495                     If  enabled, finalizers will not be run.  Everything else
1496                     will be unaffected: finalizable objects will still be put
1497                     into  the  finalization  queue  where  they survive until
1498                     they're scheduled to finalize.  Once they're not  in  the
1499                     queue  anymore  they  will  be collected regularly.  If a
1500                     list of comma-separated class names is  given,  only  ob‐
1501                     jects from those classes will not be finalized.
1502
1503
1504              log-finalizers
1505                     Log  verbosely around the finalization process to aid de‐
1506                     bugging.
1507
1508       MONO_GAC_PREFIX
1509              Provides a prefix the runtime uses to look for  Global  Assembly
1510              Caches.   Directories are separated by the platform path separa‐
1511              tor (colons on unix). MONO_GAC_PREFIX should point  to  the  top
1512              directory of a prefixed install. Or to the directory provided in
1513              the    gacutil    /gacdir    command.    Example:    /home/user‐
1514              name/.mono:/usr/local/mono/
1515
1516       MONO_IOMAP
1517              (deprecated)  Enabled  some filename rewriting support to assist
1518              badly-written applications that hard-code Windows paths.  It  no
1519              longer works as of Mono 6.0.
1520
1521       MONO_LLVM
1522              When  Mono is using the LLVM code generation backend you can use
1523              this environment variable to pass code generation options to the
1524              LLVM compiler.
1525
1526       MONO_MANAGED_WATCHER
1527              If  set  to  "disabled",  System.IO.FileSystemWatcher will use a
1528              file watcher  implementation  which  silently  ignores  all  the
1529              watching   requests.    If   set   to   any  other  value,  Sys‐
1530              tem.IO.FileSystemWatcher will use the default managed  implemen‐
1531              tation  (slow).  If  unset,  mono  will try to use inotify, FAM,
1532              Gamin, kevent under Unix systems and native API  calls  on  Win‐
1533              dows, falling back to the managed implementation on error.
1534
1535       MONO_MESSAGING_PROVIDER
1536              Mono  supports  a  plugin  model  for its implementation of Sys‐
1537              tem.Messaging making it possible to support a variety of messag‐
1538              ing  implementations  (e.g.  AMQP,  ActiveMQ).  To specify which
1539              messaging implementation is to be used the evironement  variable
1540              needs  to  be set to the full class name for the provider.  E.g.
1541              to use the  RabbitMQ  based  AMQP  implementation  the  variable
1542              should be set to:
1543
1544              Mono.Messaging.RabbitMQ.RabbitMQMessagingProvider,Mono.Messaging.RabbitMQ
1545
1546       MONO_NO_SMP
1547              If set causes the mono process to be bound to a single processor. This may be
1548              useful when debugging or working around race conditions.
1549
1550       MONO_NO_TLS
1551              Disable inlining of thread local accesses. Try setting this if you get a segfault
1552              early on in the execution of mono.
1553
1554       MONO_PATH
1555              Provides a search path to the runtime where to look for library
1556              files.   This is a tool convenient for debugging applications, but
1557              should not be used by deployed applications as it breaks the assembly
1558              loader in subtle ways.
1559              Directories are separated by the platform path separator (colons on unix). Example:
1560              /home/username/lib:/usr/local/mono/lib
1561              Relative paths are resolved based on the launch-time current directory.
1562              Alternative solutions to MONO_PATH include: installing libraries into
1563              the Global Assembly Cache (see gacutil(1)) or having the dependent
1564              libraries side-by-side with the main executable.
1565              For a complete description of recommended practices for application
1566              deployment, see
1567              http://www.mono-project.com/docs/getting-started/application-deployment/
1568
1569       MONO_SHARED_DIR
1570              If set its the directory where the ".wapi" handle state is stored.
1571              This is the directory where the Windows I/O Emulation layer stores its
1572              shared state data (files, events, mutexes, pipes).  By default Mono
1573              will store the ".wapi" directory in the users's home directory.
1574
1575       MONO_SHARED_HOSTNAME
1576              Uses the string value of this variable as a replacement for the host name when
1577              creating file names in the ".wapi" directory. This helps if the host name of
1578              your machine is likely to be changed when a mono application is running or if
1579              you have a .wapi directory shared among several different computers.
1580              Mono typically uses the hostname to create the files that are used to
1581              share state across multiple Mono processes.  This is done to support
1582              home directories that might be shared over the network.
1583
1584       MONO_STRICT_IO_EMULATION
1585              If set, extra checks are made during IO operations.  Currently, this
1586              includes only advisory locks around file writes.
1587
1588       MONO_TLS_PROVIDER
1589              This environment variable controls which TLS/SSL provider Mono will
1590              use.  The options are usually determined by the operating system where
1591              Mono was compiled and the configuration options that were used for
1592              it.
1593
1594              default
1595                     Uses the default TLS stack that the Mono runtime was configured with.
1596                     Usually this is configured to use Apple's SSL stack on Apple
1597                     platforms, and Boring SSL on other platforms.
1598
1599              apple  Forces the use of the Apple SSL stack, only works on Apple platforms.
1600
1601              btls   Forces the use of the BoringSSL stack.    See
1602                     https://opensource.google.com/projects/boringssl for more information
1603                     about this stack.
1604
1605              legacy This is the old Mono stack, which only supports SSL and TLS up to
1606                     version 1.0.   It is deprecated and will be removed in the future.
1607
1608       MONO_TLS_SESSION_CACHE_TIMEOUT
1609              The time, in seconds, that the SSL/TLS session cache will keep it's entry to
1610              avoid a new negotiation between the client and a server. Negotiation are very
1611              CPU intensive so an application-specific custom value may prove useful for
1612              small embedded systems.
1613              The default is 180 seconds.
1614
1615       MONO_THREADS_PER_CPU
1616              The minimum number of threads in the general threadpool will be
1617              MONO_THREADS_PER_CPU * number of CPUs. The default value for this
1618              variable is 1.
1619
1620       MONO_XMLSERIALIZER_THS
1621              Controls the threshold for the XmlSerializer to produce a custom
1622              serializer for a given class instead of using the Reflection-based
1623              interpreter.  The possible values are `no' to disable the use of a
1624              custom serializer or a number to indicate when the XmlSerializer
1625              should start serializing.   The default value is 50, which means that
1626              the a custom serializer will be produced on the 50th use.
1627
1628       MONO_X509_REVOCATION_MODE
1629              Sets the revocation mode used when validating a X509 certificate chain (https,
1630              ftps, smtps...).  The default is 'nocheck', which performs no revocation check
1631              at all. The other possible values are 'offline', which performs CRL check (not
1632              implemented yet) and 'online' which uses OCSP and CRL to verify the revocation
1633              status (not implemented yet).
1634
1635       NO_PROXY
1636              (Also no_proxy) If both HTTP_PROXY and NO_PROXY are
1637              set, NO_PROXY will be treated as a comma-separated list of "bypass" domains
1638              which will not be sent through the proxy. Domains in NO_PROXY may contain
1639              wildcards, as in "*.mono-project.com" or "build????.local". Not supported on
1640              Windows, Mac OS, iOS or Android.
1641

ENVIRONMENT VARIABLES FOR DEBUGGING

1643       MONO_ASPNET_NODELETE
1644              If set to any value, temporary source files generated by ASP.NET
1645              support classes will not be removed. They will be  kept  in  the
1646              user's temporary directory.
1647
1648       MONO_DEBUG
1649              If  set,  enables some features of the runtime useful for debug‐
1650              ging.  This variable should contain a comma  separated  list  of
1651              debugging  options.   Currently,  the following options are sup‐
1652              ported:
1653
1654              align-small-structs
1655                     Enables small structs alignment to 4/8 bytes.
1656
1657              arm-use-fallback-tls
1658                     When this option is set on ARM, a fallback  thread  local
1659                     store will be used instead of the default fast thread lo‐
1660                     cal storage primitives.
1661
1662              break-on-unverified
1663                     If this variable is set, when the Mono  VM  runs  into  a
1664                     verification problem, instead of throwing an exception it
1665                     will break into the debugger.  This is useful when debug‐
1666                     ging verifier problems
1667
1668              casts  This  option can be used to get more detailed information
1669                     from InvalidCast exceptions, it will provide  information
1670                     about the types involved.
1671
1672              check-pinvoke-callconv
1673                     This  option causes the runtime to check for calling con‐
1674                     vention  mismatches  when  using  pinvoke,  i.e.   mixing
1675                     cdecl/stdcall. It only works on windows. If a mismatch is
1676                     detected, an ExecutionEngineException is thrown.
1677
1678              collect-pagefault-stats
1679                     Collects information about pagefaults.   This is used in‐
1680                     ternally  to  track the number of page faults produced to
1681                     load metadata.  To display this information you must  use
1682                     this option with "--stats" command line option.
1683
1684              debug-domain-unload
1685                     When  this option is set, the runtime will invalidate the
1686                     domain memory pool instead of destroying it.
1687
1688              disable_omit_fp
1689                     Disables a compiler optimization where the frame  pointer
1690                     is omitted from the stack. This optimization can interact
1691                     badly with debuggers.
1692
1693              dont-free-domains
1694                     This is an Optimization for multi-AppDomain  applications
1695                     (most  commonly  ASP.NET  applications).  Due to internal
1696                     limitations Mono, Mono by default does not use typed  al‐
1697                     locations  on  multi-appDomain applications as they could
1698                     leak memory when a domain is unloaded.  Although this  is
1699                     a  fine  default,  for applications that use more than on
1700                     AppDomain heavily (for example, ASP.NET applications)  it
1701                     is  worth  trading  off the small leaks for the increased
1702                     performance (additionally, since ASP.NET applications are
1703                     not  likely  going  to  unload the application domains on
1704                     production systems, it is worth using this feature).
1705
1706              dyn-runtime-invoke
1707                     Instructs the runtime to try to use a generic runtime-in‐
1708                     voke wrapper instead of creating one invoke wrapper.
1709
1710              explicit-null-checks
1711                     Makes the JIT generate an explicit NULL check on variable
1712                     dereferences instead of depending on the operating system
1713                     to  raise a SIGSEGV or another form of trap event when an
1714                     invalid memory location is accessed.
1715
1716              gdb    Equivalent to  setting  the  MONO_XDEBUG  variable,  this
1717                     emits  symbols into a shared library as the code is JITed
1718                     that can be loaded into GDB to inspect symbols.
1719
1720              gen-seq-points
1721                     Automatically generates  sequence  points  where  the  IL
1722                     stack  is empty.  These are places where the debugger can
1723                     set a breakpoint.
1724
1725              llvm-disable-implicit-null-checks
1726                     Makes the LLVM backend use explicit NULL checks on  vari‐
1727                     able  dereferences instead of depending on operating sys‐
1728                     tem support for signals or traps when an  invalid  memory
1729                     location  is  accessed.  Unconditionally  enabled  by ex‐
1730                     plicit-null-checks.
1731
1732              no-compact-seq-points
1733                     Unless the option is used, the runtime generates sequence
1734                     points  data  that maps native offsets to IL offsets. Se‐
1735                     quence point data is used to display IL offset in  stack‐
1736                     traces.  Stacktraces  with IL offsets can be symbolicated
1737                     using mono-symbolicate tool.
1738
1739              handle-sigint
1740                     Captures the interrupt signal (Control-C) and displays  a
1741                     stack  trace  when pressed.  Useful to find out where the
1742                     program is executing at a given point.   This  only  dis‐
1743                     plays the stack trace of a single thread.
1744
1745              init-stacks
1746                     Instructs  the  runtime to initialize the stack with some
1747                     known values (0x2a on x86-64) at the start of a method to
1748                     assist in debuggin the JIT engine.
1749
1750              keep-delegates
1751                     This  option  will  leak delegate trampolines that are no
1752                     longer referenced as to present the user with more infor‐
1753                     mation about a delegate misuse.  Basically a delegate in‐
1754                     stance might be created, passed to unmanaged code, and no
1755                     references  kept in managed code, which will garbage col‐
1756                     lect the code.  With this option it is possible to  track
1757                     down the source of the problems.
1758
1759              no-gdb-backtrace
1760                     This option will disable the GDB backtrace emitted by the
1761                     runtime after a SIGSEGV or SIGABRT in unmanaged code.
1762
1763              partial-sharing
1764                     When this option is set, the runtime can share  generated
1765                     code  between  generic  types  effectively  reducing  the
1766                     amount of code generated.
1767
1768              reverse-pinvoke-exceptions
1769                     This option will cause mono to abort with  a  descriptive
1770                     message when during stack unwinding after an exception it
1771                     reaches a native stack frame. This happens when a managed
1772                     delegate  is passed to native code, and the managed dele‐
1773                     gate throws an exception. Mono will normally try  to  un‐
1774                     wind  the stack to the first (managed) exception handler,
1775                     and it will skip any native stack frames in the  process.
1776                     This  leads  to  undefined  behaviour (since mono doesn't
1777                     know how to process native frames), leaks,  and  possibly
1778                     crashes too.
1779
1780              single-imm-size
1781                     This  guarantees  that each time managed code is compiled
1782                     the same instructions and registers are used,  regardless
1783                     of the size of used values.
1784
1785              soft-breakpoints
1786                     This  option allows using single-steps and breakpoints in
1787                     hardware where we cannot do it with signals.
1788
1789              suspend-on-native-crash
1790                     This option will suspend the program when a native  crash
1791                     occurs (SIGSEGV, SIGILL, ...).  This is useful for debug‐
1792                     ging crashes which do not happen under gdb, since a  live
1793                     process contains more information than a core file.
1794
1795              suspend-on-sigsegv
1796                     Same as suspend-on-native-crash.
1797
1798              suspend-on-exception
1799                     This  option  will  suspend the program when an exception
1800                     occurs.
1801
1802              suspend-on-unhandled
1803                     This option will suspend the program  when  an  unhandled
1804                     exception occurs.
1805
1806              thread-dump-dir=DIR
1807                     Use DIR for storage thread dumps created by SIGQUIT.
1808
1809              weak-memory-model
1810                     Don't enforce the CLR memory model on platforms with weak
1811                     memory models. This can introduce random crashes in  some
1812                     rare  cases,  for multithreaded environments. This can be
1813                     used for a performance boost  on  applications  that  are
1814                     single threaded.
1815
1816              verbose-gdb
1817                     Make gdb output on native crashes more verbose.
1818
1819       MONO_LOG_LEVEL
1820              The  logging  level,  possible  values  are `error', `critical',
1821              `warning', `message', `info' and  `debug'.   See  the  DEBUGGING
1822              section for more details.
1823
1824       MONO_LOG_MASK
1825              Controls  the domain of the Mono runtime that logging will apply
1826              to.  If set, the log mask is changed to the set value.  Possible
1827              values  are  "asm"  (assembly loader), "type", "dll" (native li‐
1828              brary loader), "gc"  (garbage  collector),  "cfg"  (config  file
1829              loader), "aot" (precompiler), "security" (e.g. Moonlight CoreCLR
1830              support) and "all".  The default value is  "all".  Changing  the
1831              mask  value  allows  you  to display only messages for a certain
1832              component. You can use multiple masks by comma separating  them.
1833              For example to see config file messages and assembly loader mes‐
1834              sages set you mask to "asm,cfg".
1835
1836       MONO_LOG_DEST
1837              Controls where trace log messages are written. If not  set  then
1838              the  messages go to stdout.  If set, the string either specifies
1839              a path to a file that will have messages appended to it, or  the
1840              string  "syslog"  in  which case the messages will be written to
1841              the system log.  Under Windows, this is simulated by writing  to
1842              a  file  called  "mono.log".   MONO_LOG_HEADER  Controls whether
1843              trace log messages not directed to syslog  have  the  id,  time‐
1844              stamp,  and  pid  as  the prefix to the log message. To enable a
1845              header this environment variable need just be non-null.
1846
1847       MONO_TRACE
1848              Used for runtime tracing of method  calls.  The  format  of  the
1849              comma separated trace options is:
1850
1851                   [-]M:method name
1852                   [-]N:namespace
1853                   [-]T:class name
1854                   [-]all
1855                   [-]program
1856                   disabled       Trace output off upon start.
1857
1858              You  can  toggle trace output on/off sending a SIGUSR2 signal to
1859              the program.
1860
1861       MONO_TRACE_LISTENER
1862              If  set,  enables  the  System.Diagnostics.DefaultTraceListener,
1863              which  will print the output of the System.Diagnostics Trace and
1864              Debug classes.  It can be set to a filename, and to  Console.Out
1865              or  Console.Error  to display output to standard output or stan‐
1866              dard error, respectively. If it's set  to  Console.Out  or  Con‐
1867              sole.Error  you  can append an optional prefix that will be used
1868              when writing messages  like  this:  Console.Error:MyProgramName.
1869              See  the  System.Diagnostics.DefaultTraceListener  documentation
1870              for more information.
1871
1872       MONO_WCF_TRACE
1873              This eases WCF diagnostics functionality by simply  outputs  all
1874              log  messages  from WCF engine to "stdout", "stderr" or any file
1875              passed to this environment variable. The log format is the  same
1876              as usual diagnostic output.
1877
1878       MONO_XEXCEPTIONS
1879              This throws an exception when a X11 error is encountered; by de‐
1880              fault a message is displayed but execution continues
1881
1882       MONO_XMLSERIALIZER_DEBUG
1883              Set this value to 1 to prevent the serializer from removing  the
1884              temporary  files  that are created for fast serialization;  This
1885              might be useful when debugging.
1886
1887       MONO_XSYNC
1888              This is used in  the  System.Windows.Forms  implementation  when
1889              running with the X11 backend.  This is used to debug problems in
1890              Windows.Forms as it forces all  of  the  commands  send  to  X11
1891              server to be done synchronously.   The default mode of operation
1892              is asynchronous which makes it hard to isolate the root of  cer‐
1893              tain problems.
1894
1895       MONO_XDEBUG
1896              When the the MONO_XDEBUG env var is set, debugging info for JIT‐
1897              ted code is emitted into a shared library,  loadable  into  gdb.
1898              This  enables,  for  example,  to see managed frame names on gdb
1899              backtraces.
1900
1901       MONO_VERBOSE_METHOD
1902              Enables the maximum JIT verbosity for the specified method. This
1903              is very helpfull to diagnose a miscompilation problems of a spe‐
1904              cific method.   This can be a semicolon-separated list of method
1905              names  to  match.   If  the  name is simple, this applies to any
1906              method with that name, otherwise you can use a mono  method  de‐
1907              scription (see the section METHOD DESCRIPTIONS).
1908
1909       MONO_JIT_DUMP_METHOD
1910              Enables  sending  of  the JITs intermediate representation for a
1911              specified method to the IdealGraphVisualizer tool.
1912
1913       MONO_VERBOSE_HWCAP
1914              If set, makes the JIT output information about detected CPU fea‐
1915              tures (such as SSE, CMOV, FCMOV, etc) to stdout.
1916
1917       MONO_CONSERVATIVE_HWCAP
1918              If  set, the JIT will not perform any hardware capability detec‐
1919              tion. This may be useful to pinpoint the cause  of  JIT  issues.
1920              This is the default when Mono is built as an AOT cross compiler,
1921              so that the generated code will run on most hardware.
1922

VALGRIND

1924       If you want to use Valgrind, you will find the file `mono.supp' useful,
1925       it  contains  the suppressions for the GC which trigger incorrect warn‐
1926       ings.  Use it like this:
1927           valgrind --suppressions=mono.supp mono ...
1928

DTRACE

1930       On some platforms, Mono can expose a set of DTrace probes  (also  known
1931       as user-land statically defined, USDT Probes).
1932
1933       They are defined in the file `mono.d'.
1934
1935       ves-init-begin, ves-init-end
1936              Begin and end of runtime initialization.
1937
1938       method-compile-begin, method-compile-end
1939              Begin  and  end  of method compilation.  The probe arguments are
1940              class name, method name and signature, and in  case  of  method-
1941              compile-end success or failure of compilation.
1942
1943       gc-begin, gc-end
1944              Begin and end of Garbage Collection.
1945
1946       To verify the availability of the probes, run:
1947                  dtrace -P mono'$target' -l -c mono
1948

PERMISSIONS

1950       Mono's  Ping implementation for detecting network reachability can cre‐
1951       ate the ICMP packets itself without requiring the system  ping  command
1952       to  do  the  work.   If  you  want to enable this on Linux for non-root
1953       users, you need to give the Mono binary special permissions.
1954
1955       As root, run this command:
1956          # setcap cap_net_raw=+ep /usr/bin/mono
1957

FILES

1959       On Unix assemblies are loaded from the installation lib directory.   If
1960       you  set  `prefix' to /usr, the assemblies will be located in /usr/lib.
1961       On Windows, the assemblies are loaded from the directory where mono and
1962       mint live.
1963
1964       ~/.mono/aot-cache
1965              The directory for the ahead-of-time compiler demand creation as‐
1966              semblies are located.
1967
1968       /etc/mono/config, ~/.mono/config
1969              Mono runtime configuration file.  See the mono-config(5)  manual
1970              page for more information.
1971
1972       ~/.config/.mono/certs, /usr/share/.mono/certs
1973              Contains  Mono  certificate  stores for users / machine. See the
1974              certmgr(1) manual page for more information on managing certifi‐
1975              cate  stores  and the mozroots(1) page for information on how to
1976              import the Mozilla root certificates into the  Mono  certificate
1977              store.
1978
1979       ~/.mono/assemblies/ASSEMBLY/ASSEMBLY.config
1980              Files in this directory allow a user to customize the configura‐
1981              tion for a given system assembly, the  format  is  the  one  de‐
1982              scribed in the mono-config(5) page.
1983
1984       ~/.config/.mono/keypairs, /usr/share/.mono/keypairs
1985              Contains  Mono  cryptographic keypairs for users / machine. They
1986              can be accessed by using a CspParameters  object  with  DSACryp‐
1987              toServiceProvider and RSACryptoServiceProvider classes.
1988
1989       ~/.config/.isolatedstorage,            ~/.local/share/.isolatedstorage,
1990       /usr/share/.isolatedstorage
1991              Contains Mono isolated storage for  non-roaming  users,  roaming
1992              users  and local machine. Isolated storage can be accessed using
1993              the classes from the System.IO.IsolatedStorage namespace.
1994
1995       <assembly>.config
1996              Configuration information for individual assemblies is loaded by
1997              the  runtime from side-by-side files with the .config files, see
1998              the http://www.mono-project.com/Config for more information.
1999
2000       Web.config, web.config
2001              ASP.NET applications are configured  through  these  files,  the
2002              configuration is done on a per-directory basis.  For more infor‐
2003              mation on this subject see the  http://www.mono-project.com/Con
2004              fig_system.web page.
2005

MAILING LISTS

2007       Mailing  lists  are  listed  at  the http://www.mono-project.com/commu
2008       nity/help/mailing-lists/
2009

WEB SITE

2011       http://www.mono-project.com
2012

SEE ALSO

2014       certmgr(1), cert-sync(1), csharp(1),  gacutil(1),  mcs(1),  monodis(1),
2015       mono-config(5), mono-profilers(1), mprof-report(1), pdb2mdb(1), xsp(1),
2016       mod_mono(8)
2017
2018       For  more  information  on  AOT:   http://www.mono-project.com/docs/ad
2019       vanced/aot/
2020
2021       For ASP.NET-related documentation, see the xsp(1) manual page
2022
2023
2024
2025                                                                    Mono(mono)
Impressum