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 additionaly functionality in the form
23       of assembly references.   By  default  those  assembly  references  are
24       resolved  as follows: the mscorlib.dll is resolved from the system pro‐
25       file that is configured by Mono, and other assemblies are  loaded  from
26       the Global 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
37       applications, for developing and debugging, and for testing and  debug‐
38       ging 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
69       either  a  full  typename, or for built-in types it should use the low-
70       level ILAsm type names for the built-in  types,  like  'void',  'char',
71       'bool', '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
116              detected  at runtime) so you should not try to move the pre-gen‐
117              erated assemblies or package the  pre-generated  assemblies  for
118              deployment.   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
124                     instead 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.
136                     Developers need to then ship the resulting aotdata  as  a
137                     resource  and  register a hook to load the data on demand
138                     by 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
149                     invoked  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
157                     information 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
163                     --hybrid-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 override the  built-in  set  of  flags
180                     passed  to  the  LLVM  optimizer.    The list of possible
181                     flags that can be passed can be obtained by  calling  the
182                     bundled opt program that comes with Mono.
183
184              llvm-outfile=[filename]
185                     Gives  the  path for the temporary LLVM bitcode file cre‐
186                     ated during AOT.  dedup Each AOT  module  will  typically
187                     contain  the  code for inflated methods and wrappers that
188                     are called by code in that  module.  In  dedup  mode,  we
189                     identify  and  skip  compiling all of those methods. When
190                     using this mode with fullaot, dedup-include  is  required
191                     or these methods will remain missing.
192
193              dedup-include=[filename]
194                     In  dedup-include mode, we are in the pass of compilation
195                     where we compile  the  methods  that  we  had  previously
196                     skipped.  All  of them are emitted into the assembly that
197                     is passed as this option. We consolidate the many  dupli‐
198                     cate skipped copies of the same method into one.
199
200
201              info   Print the architecture the AOT in this copy
202                     of Mono targets and quit.
203
204              interp Generates all required wrappers, so that it
205                     is  possible  to  run --interpreter without
206                     any  code  generation  at  runtime.    This
207                     option  only makes sense with mscorlib.dll.
208                     Embedders can set
209
210                     mono_jit_set_aot_mode (MONO_AOT_MODE_INTERP);
211
212              ld-flags
213                     Additional flags to pass to  the  C  linker
214                     (if the current AOT mode calls for invoking
215                     it).
216
217              llvm-path=<PREFIX>
218                     Same for the llvm tools 'opt' and 'llc'.
219
220              msym-dir=<PATH>
221                     Instructs the AOT compiler to generate off‐
222                     line sequence points .msym files.  The gen‐
223                     erated .msym files will be  stored  into  a
224                     subfolder  of  <PATH> named as the compila‐
225                     tion AOTID.
226
227              mtriple=<TRIPLE>
228                     Use the GNU style target triple <TRIPLE> to
229                     determine  some  code  generation  options,
230                     i.e.   --mtriple=armv7-linux-gnueabi   will
231                     generate  code  that targets ARMv7. This is
232                     currently only supported by the  ARM  back‐
233                     end. In LLVM mode, this triple is passed on
234                     to the LLVM llc compiler.
235
236              nimt-trampolines=[number]
237                     When compiling in full aot  mode,  the  IMT
238                     trampolines  must  be precreated in the AOT
239                     image.  You can add additional method tram‐
240                     polines  with  this  argument.  Defaults to
241                     512.
242
243              ngsharedvt-trampolines=[number]
244                     When compiling in full aot mode, the  value
245                     type  generic  sharing  trampolines must be
246                     precreated in the AOT image.  You  can  add
247                     additional  method  trampolines  with  this
248                     argument.  Defaults to 512.
249
250              nodebug
251                     Instructs the AOT compiler  to  not  output
252                     any debugging information.
253
254              no-direct-calls
255                     This  prevents the AOT compiler from gener‐
256                     ating a direct calls to a method.   The AOT
257                     compiler usually generates direct calls for
258                     certain methods that do not  require  going
259                     through  the PLT (for example, methods that
260                     are known to not  require  a  hook  like  a
261                     static  constructor)  or  call  into simple
262                     internal calls.
263
264              nrgctx-trampolines=[number]
265                     When  compiling  in  full  aot  mode,   the
266                     generic sharing trampolines must be precre‐
267                     ated in the AOT image.  You can  add  addi‐
268                     tional  method  trampolines with this argu‐
269                     ment.  Defaults to 4096.
270
271              nrgctx-fetch-trampolines=[number]
272                     When  compiling  in  full  aot  mode,   the
273                     generic  sharing  fetch trampolines must be
274                     precreated in the AOT image.  You  can  add
275                     additional  method  trampolines  with  this
276                     argument.  Defaults to 128.
277
278              ntrampolines=[number]
279                     When compiling in full aot mode, the method
280                     trampolines  must  be precreated in the AOT
281                     image.  You can add additional method tram‐
282                     polines  with  this  argument.  Defaults to
283                     4096.
284
285              outfile=[filename]
286                     Instructs the AOT compiler to save the out‐
287                     put to the specified file.
288
289              print-skipped-methods
290                     If the AOT compiler cannot compile a method
291                     for any reason,  enabling  this  flag  will
292                     output the skipped methods to the console.
293
294              profile=[file]
295                     Specify  a  file  to use for profile-guided
296                     optimization. See the AOT profiler sub-sec‐
297                     tion.  To  specify  multiple files, include
298                     the profile option multiple times.
299
300              profile-only
301                     AOT *only* the  methods  described  in  the
302                     files  specified  with  the profile option.
303                     See the AOT profiler sub-section.
304
305              readonly-value=namespace.typename.field‐
306              name=type/value
307                     Override  the  value  of  a static readonly
308                     field. Usually, during JIT compilation, the
309                     static  constructor  is ran eagerly, so the
310                     value of a static readonly field  is  known
311                     at compilation time and the compiler can do
312                     a number of optimizations based on it. Dur‐
313                     ing  AOT,  instead,  the static constructor
314                     can't be ran, so this option can be used to
315                     set  the  value  of such a field and enable
316                     the same set of optimizations.  Type can be
317                     any  of  i1,  i2,  i4  for  integers of the
318                     respective sizes  (in  bytes).   Note  that
319                     signed/unsigned numbers do not matter here,
320                     just the storage size.  This option can  be
321                     specified  multiple  times  and  it doesn't
322                     prevent the static constructor for the type
323                     defining  the  field  to  execute  with the
324                     usual rules at runtime (hence possibly com‐
325                     puting a different value for the field).
326
327              save-temps,keep-temps
328                     Instructs  the  AOT compiler to keep tempo‐
329                     rary files.
330
331              soft-debug
332                     This instructs  the  compiler  to  generate
333                     sequence  point  checks  that  allow Mono's
334                     soft debugger to debug applications even on
335                     systems  where  it  is  not possible to set
336                     breakpoints  or  to  single  step  (certain
337                     hardware   configurations   like  the  cell
338                     phones and video gaming consoles).
339
340              static Create an ELF object file (.o) or  .s  file
341                     which can be statically linked into an exe‐
342                     cutable when embedding  the  mono  runtime.
343                     When  this  option is used, the object file
344                     needs to be registered  with  the  embedded
345                     runtime  using the mono_aot_register_module
346                     function which takes as  its  argument  the
347                     mono_aot_module_<ASSEMBLY NAME>_info global
348                     symbol from the object file:
349
350                     extern void *mono_aot_module_hello_info;
351
352                     mono_aot_register_module (mono_aot_module_hello_info);
353
354              stats  Print various stats  collected  during  AOT
355                     compilation.
356
357              temp-path=[path]
358                     Explicitly  specify path to store temporary
359                     files created during AOT compilation.
360
361              threads=[number]
362                     This is an experimental option for the  AOT
363                     compiler  to use multiple threads when com‐
364                     piling the methods.
365
366              tool-prefix=<PREFIX>
367                     Prepends <PREFIX> to the name of tools  ran
368                     by  the  AOT  compiler, i.e. 'as'/'ld'. For
369                     example,   --tool=prefix=arm-linux-gnueabi-
370                     will make the AOT compiler run
371
372              verbose
373                     Prints  additional  information  about type
374                     loading failures.
375
376              write-symbols,no-write-symbols
377                     Instructs the AOT compiler to emit (or  not
378                     emit) debug symbol information.
379
380              For    more    information    about    AOT,   see:
381              http://www.mono-project.com/docs/advanced/aot/
382
383       --aot-path=PATH
384              List of additional directories to search  for  AOT
385              images.
386
387       --apply-bindings=FILE
388              Apply  the  assembly  bindings  from the specified
389              configuration file when running the AOT  compiler.
390              This  is useful when compiling an auxiliary assem‐
391              bly that is referenced by  a  main  assembly  that
392              provides  a  configuration  file.  For example, if
393              app.exe uses lib.dll then in  order  to  make  the
394              assembly  bindings  from  app.exe.config available
395              when compiling lib.dll ahead of time, use:
396                   mono --apply-bindings=app.exe.config --aot lib.dll
397
398       --assembly-loader=MODE
399              If mode is strict, Mono will check that the public
400              key  token,  culture  and  version  of a candidate
401              assembly matches the requested  strong  name.   If
402              mode  is  legacy, as long as the name matches, the
403              candidate will be allowed. strict is the  behavior
404              consistent  with .NET Framework but may break some
405              existing mono-based applications.  The default  is
406              legacy.
407
408       --attach=[options]
409              Currently  the  only option supported by this com‐
410              mand line argument is disable which  disables  the
411              attach functionality.
412
413       --config filename
414              Load  the  specified configuration file instead of
415              the  default  one(s).   The  default   files   are
416              /etc/mono/config  and  ~/.mono/config  or the file
417              specified in the MONO_CONFIG environment variable,
418              if  set.   See  the  mono-config(5)  man  page for
419              details on the format of this file.
420
421       --debugger-agent=[options]
422              This instructs the Mono runtime to start a  debug‐
423              ging  agent inside the Mono runtime and connect it
424              to a client user interface will control  the  Mono
425              process.   This  option is typically used by IDEs,
426              like the MonoDevelop or Visual Studio IDEs.
427              The configuration is specified using one  of  more
428              of the following options:
429
430                     address=host:port
431                            Use  this  option  to specify the IP
432                            address where your  debugger  client
433                            is listening to.
434
435                     loglevel=LEVEL
436                            Specifies  the diagnostics log level
437                            for
438
439                     logfile=filename
440                            Used to specify the file  where  the
441                            log  will  be stored, it defaults to
442                            standard output.
443
444                     server=[y/n]
445                            Defaults to  no,  with  the  default
446                            option Mono will actively connect to
447                            the host/port  configured  with  the
448                            address  option.   If  you set it to
449                            'y', it instructs the  Mono  runtime
450                            to  start  debugging in server mode,
451                            where Mono actively  waits  for  the
452                            debugger front end to connect to the
453                            Mono process.  Mono will  print  out
454                            to  stdout  the  IP address and port
455                            where it is listening.
456
457                     setpgid=[y/n]
458                            If  set  to  yes,  Mono  will   call
459                            setpgid(0,  0)  on  startup, if that
460                            function is available on the system.
461                            This  is  useful  for  ensuring that
462                            signals delivered to a process  that
463                            is  executing  the  debuggee are not
464                            propagated  to  the  debuggee,  e.g.
465                            when  Ctrl-C sends SIGINT to the sdb
466                            tool.
467
468                     suspend=[y/n]
469                            Defaults to yes,  with  the  default
470                            option  Mono  will suspend the vm on
471                            startup until it  connects  success‐
472                            fully  to  a debugger front end.  If
473                            you set it to  'n',  in  conjunction
474                            with server=y, it instructs the Mono
475                            runtime  to  run  as  normal,  while
476                            caching  metadata  to  send  to  the
477                            debugger front end on connection..
478
479                     transport=transport_name
480                            This is used to specify  the  trans‐
481                            port  that  the debugger will use to
482                            communicate.   It must be  specified
483                            and  currently  requires  this to be
484                            'dt_socket'.
485
486              --desktop
487                     Configures the virtual machine to be better
488                     suited for desktop applications.  Currently
489                     this sets the GC system to avoid  expanding
490                     the heap as much as possible at the expense
491                     of slowing down garbage collection a bit.
492
493              --full-aot
494                     This flag instructs the Mono runtime to not
495                     generate  any  code  at  runtime and depend
496                     exclusively  on  the  code  generated  from
497                     using  mono --aot=full previously.  This is
498                     useful for platforms  that  do  not  permit
499                     dynamic  code generation, or if you need to
500                     run assemblies that have been  stripped  of
501                     IL   (for  example  using  mono-cil-strip).
502                     Notice that this feature will abort  execu‐
503                     tion  at runtime if a codepath in your pro‐
504                     gram, or Mono's class libraries attempts to
505                     generate code dynamically.  You should test
506                     your software upfront and  make  sure  that
507                     you do not use any dynamic features.
508
509              --full-aot-interp
510                     Same  as  --full-aot  with  fallback to the
511                     interpreter.
512
513              --gc=boehm, --gc=sgen
514                     Selects the Garbage  Collector  engine  for
515                     Mono to use, Boehm or SGen.  Currently this
516                     merely ensures that you are running  either
517                     the  mono  or  mono-sgen  commands.    This
518                     flag can be  set  in  the  MONO_ENV_OPTIONS
519                     environment  variable  to force all of your
520                     child processes to use one particular  kind
521                     of GC with the Mono runtime.
522
523              --gc-debug=[options]
524                     Command     line    equivalent    of    the
525                     MONO_GC_DEBUG environment variable.
526
527              --gc-params=[options]
528                     Command    line    equivalent    of     the
529                     MONO_GC_PARAMS environment variable.
530
531              --arch=32, --arch=64
532                     (Mac OS X only): Selects the bitness of the
533                     Mono binary  used,  if  available.  If  the
534                     binary  used  is  already  for the selected
535                     bitness, nothing changes. If not, the  exe‐
536                     cution   switches  to  a  binary  with  the
537                     selected bitness suffix installed  side  by
538                     side  (for  example,  '/bin/mono --arch=64'
539                     will   switch    to    '/bin/mono64'    iff
540                     '/bin/mono' is a 32-bit build).
541
542              --help, -h
543                     Displays usage instructions.
544
545              --interpreter
546                     The  Mono  runtime will use its interpreter
547                     to execute a given  assembly.   The  inter‐
548                     preter  is usually slower than the JIT, but
549                     it can be useful on  platforms  where  code
550                     generation at runtime is not allowed.
551
552              --hybrid-aot
553                     This  flag  allows  the Mono runtime to run
554                     assemblies that have been stripped  of  IL,
555                     for  example using mono-cil-strip. For this
556                     to work, the assembly must  have  been  AOT
557                     compiled with --aot=hybrid.
558
559                     This  flag is similar to --full-aot, but it
560                     does not disable the JIT.  This  means  you
561                     can  use  dynamic  features  such  as  Sys‐
562                     tem.Reflection.Emit.
563
564              --llvm If the Mono runtime has been compiled  with
565                     LLVM support (not available in all configu‐
566                     rations), Mono will use the LLVM  optimiza‐
567                     tion  and  code generation engine to JIT or
568                     AOT compile.  For  more  information,  con‐
569                     sult:                      http://www.mono-
570                     project.com/docs/advanced/mono-llvm/
571
572              --nollvm
573                     When using a Mono that  has  been  compiled
574                     with  LLVM support, it forces Mono to fall‐
575                     back to its JIT engine and not use the LLVM
576                     backend.
577
578              --optimize=MODE, -O=MODE
579                     MODE is a comma separated list of optimiza‐
580                     tions.  They also allow optimizations to be
581                     turned  off  by  prefixing the optimization
582                     name with a minus sign.  In  general,  Mono
583                     has  been  tuned  to use the default set of
584                     flags,  before  using  these  flags  for  a
585                     deployment setting, you might want to actu‐
586                     ally measure the benefits  of  using  them.
587                     The following optimization flags are imple‐
588                     mented in the core engine:
589                                  abcrem     Array bound checks removal
590                                  all        Turn on all optimizations
591                                  aot        Usage of Ahead Of Time compiled code
592                                  branch     Branch optimizations
593                                  cfold      Constant folding
594                                  cmov       Conditional moves [arch-dependency]
595                                  deadce     Dead code elimination
596                                  consprop   Constant propagation
597                                  copyprop   Copy propagation
598                                  fcmov      Fast x86 FP compares [arch-dependency]
599                                  float32     Perform 32-bit float arithmetic using 32-bit operations
600                                  gshared    Enable generic code sharing.
601                                  inline     Inline method calls
602                                  intrins    Intrinsic method implementations
603                                  linears    Linear scan global reg allocation
604                                  leaf       Leaf procedures optimizations
605                                  loop       Loop related optimizations
606                                  peephole   Peephole postpass
607                                  precomp    Precompile all methods before executing Main
608                                  sched      Instruction scheduling
609                                  shared     Emit per-domain code
610                                  sse2       SSE2 instructions on x86 [arch-dependency]
611                                  tailc      Tail recursion and tail calls
612                     For example, to enable all the optimization
613                     but dead code elimination and inlining, you
614                     can use:
615                          -O=all,-deadce,-inline
616                     The flags  that  are  flagged  with  [arch-
617                     dependency]  indicate that the given option
618                     if used in combination with Ahead  of  Time
619                     compilation (--aot flag) would produce pre-
620                     compiled code that will depend on the  cur‐
621                     rent  CPU  and might not be safely moved to
622                     another computer.
623
624                     The following optimizations are supported
625
626                     float32
627                            Requests that the  runtime  performn
628                            32-bit   floating  point  operations
629                            using only 32-bits.   By default the
630                            Mono  runtime tries to use the high‐
631                            est precision available for floating
632                            point  operations,  but  while  this
633                            might  render  better  results,  the
634                            code   might   run   slower.    This
635                            options also affects the code gener‐
636                            ated by the LLVM backend.
637
638                     inline Controls  whether the runtime should
639                            attempt to inline (the default),  or
640                            not inline methods invocations
641              --response=FILE  Provides  a  response  file, this
642              instructs the Mono command to read  other  command
643              line  options  from  the specified file, as if the
644              options had been specified on  the  command  line.
645              Useful when you have very long command lines.
646
647              --runtime=VERSION
648                     Mono  supports  different runtime versions.
649                     The version used  depends  on  the  program
650                     that  is  being run or on its configuration
651                     file   (named   program.exe.config).   This
652                     option can be used to override such autode‐
653                     tection, by  forcing  a  different  runtime
654                     version  to  be used. Note that this should
655                     only be used to select a  later  compatible
656                     runtime  version  than  the one the program
657                     was compiled against. A  typical  usage  is
658                     for running a 1.1 program on a 2.0 version:
659                              mono --runtime=v2.0.50727 program.exe
660
661              --security, --security=mode
662                     Activate  the security manager, a currently
663                     experimental feature in Mono and it is  OFF
664                     by  default.  The  new code verifier can be
665                     enabled with this option as well.
666
667                     Using security without parameters is equiv‐
668                     alent  as calling it with the "cas" parame‐
669                     ter.
670
671                     The following modes are supported:
672
673                     core-clr
674                            Enables the core-clr  security  sys‐
675                            tem,   typically   used   for  Moon‐
676                            light/Silverlight applications.   It
677                            provides  a  much  simpler  security
678                            system      than      CAS,       see
679                            http://www.mono-
680                            project.com/docs/web/moonlight/  for
681                            more   details   and  links  to  the
682                            descriptions of this new system.
683
684                     validil
685                            Enables the new  verifier  and  per‐
686                            forms  basic  verification  for code
687                            validity.  In this mode, unsafe code
688                            and  P/Invoke are allowed. This mode
689                            provides a better  safety  guarantee
690                            but it is still possible for managed
691                            code to crash Mono.
692
693                     verifiable
694                            Enables the new  verifier  and  per‐
695                            forms  full verification of the code
696                            being executed.  It only allows ver‐
697                            ifiable code to be executed.  Unsafe
698                            code is not allowed but P/Invoke is.
699                            This  mode  should not allow managed
700                            code to crash mono.   The  verifica‐
701                            tion  is  not  as strict as ECMA 335
702                            standard in order to stay compatible
703                            with the MS runtime.
704
705                     The security system acts on user code: code
706                     contained in mscorlib or the global  assem‐
707                     bly cache is always trusted.
708
709              --server
710                     Configures the virtual machine to be better
711                     suited for  server  operations  (currently,
712                     allows  a  heavier  threadpool  initializa‐
713                     tion).
714
715              --verify-all
716                     Verifies mscorlib  and  assemblies  in  the
717                     global assembly cache for valid IL, and all
718                     user code for IL verifiability.
719
720                     This is different from --security's verifi‐
721                     able  or validil in that these options only
722                     check  user  code  and  skip  mscorlib  and
723                     assemblies  located  on the global assembly
724                     cache.
725
726              -V, --version
727                     Prints JIT version information (system con‐
728                     figuration, release number and branch names
729                     if available).
730
731
732

DEVELOPMENT OPTIONS

734       The following options are used to help when developing  a
735       JITed application.
736
737       --debug, --debug=OPTIONS
738              Turns on the debugging mode in the runtime.  If an
739              assembly was compiled with debugging  information,
740              it  will produce line number information for stack
741              traces.
742
743              The optional OPTIONS argument is a comma separated
744              list  of  debugging  options.   These  options are
745              turned off by default  since  they  generate  much
746              larger and slower code at runtime.
747
748              The following options are supported:
749
750              casts  Produces  a  detailed error when throwing a
751                     InvalidCastException.   This  option  needs
752                     to  be  enabled as this generates more ver‐
753                     bose code at execution time.
754
755              mdb-optimizations
756                     Disable some JIT  optimizations  which  are
757                     usually  only  disabled when running inside
758                     the debugger.  This can be helpful  if  you
759                     want  to attach to the running process with
760                     mdb.
761
762              gdb    Generate and register debugging information
763                     with  gdb.  This  is only supported on some
764                     platforms, and only when using gdb  7.0  or
765                     later.
766
767       --profile[=profiler[:profiler_args]]
768              Loads  a profiler module with the given arguments.
769              For more information, see the  PROFILING  section.
770              This  option can be used multiple times; each time
771              will load an additional profiler module.
772
773       --trace[=expression]
774              Shows  method  names  as  they  are  invoked.   By
775              default  all methods are traced.  The trace can be
776              customized to include or exclude methods,  classes
777              or assemblies.  A trace expression is a comma sep‐
778              arated list of targets, each target  can  be  pre‐
779              fixed  with  a minus sign to turn off a particular
780              target.  The words `program', `all' and `disabled'
781              have  special  meaning.   `program'  refers to the
782              main program being executed, and `all'  means  all
783              the  method  calls.  The `disabled' option is used
784              to start up with  tracing  disabled.   It  can  be
785              enabled at a later point in time in the program by
786              sending the SIGUSR2 signal to the runtime.  Assem‐
787              blies are specified by their name, for example, to
788              trace all calls in the System assembly, use:
789
790                   mono --trace=System app.exe
791
792              Classes are specified with  the  T:  prefix.   For
793              example,  to  trace all calls to the System.String
794              class, use:
795
796                   mono --trace=T:System.String app.exe
797
798              And individual methods are referenced with the  M:
799              prefix, and the standard method notation:
800
801                   mono --trace=M:System.Console:WriteLine app.exe
802
803              Exceptions  can  also  be  traced, it will cause a
804              stack trace to be printed every time an  exception
805              of  the  specified  type is thrown.  The exception
806              type can be specified with or without  the  names‐
807              pace,  and  to trace all exceptions, specify 'all'
808              as the type name.
809
810                   mono --trace=E:System.Exception app.exe
811
812              As previously noted, various rules can  be  speci‐
813              fied at once:
814
815                   mono --trace=T:System.String,T:System.Random app.exe
816
817              You  can  exclude  pieces, the next example traces
818              calls  to  System.String  except  for   the   Sys‐
819              tem.String:Concat method.
820
821                   mono --trace=T:System.String,-M:System.String:Concat
822
823              You  can  trace  managed  to unmanaged transitions
824              using the wrapper qualifier:
825
826                   mono --trace=wrapper app.exe
827
828              Finally, namespaces can be specified using the  N:
829              prefix:
830
831                   mono --trace=N:System.Xml
832
833
834       --no-x86-stack-align
835              Don't  align stack frames on the x86 architecture.
836              By default, Mono aligns stack frames to  16  bytes
837              on  x86,  so  that  local  floating point and SIMD
838              variables can be properly  aligned.   This  option
839              turns  off  the alignment, which usually saves one
840              instruction per call, but might result in signifi‐
841              cantly lower floating point and SIMD performance.
842
843       --jitmap
844              Generate  a  JIT method map in a /tmp/perf-PID.map
845              file. This file is then used, for example, by  the
846              perf  tool included in recent Linux kernels.  Each
847              line in the file has:
848
849                   HEXADDR HEXSIZE methodname
850
851              Currently this option is only supported on Linux.
852

JIT MAINTAINER OPTIONS

854       The maintainer options are only used by those  developing
855       the runtime itself, and not typically of interest to run‐
856       time users or developers.
857
858       --bisect=optimization:filename
859              This flag is used by  the  automatic  optimization
860              bug bisector.  It takes an optimization flag and a
861              filename of a  file  containing  a  list  of  full
862              method  names, one per line.  When it compiles one
863              of the methods in the file it will use  the  opti‐
864              mization  given,  in addition to the optimizations
865              that are otherwise  enabled.   Note  that  if  the
866              optimization  is  enabled  by  default, you should
867              disable it with `-O`, otherwise it will just apply
868              to every method, whether it's in the file or not.
869
870       --break method
871              Inserts  a breakpoint before the method whose name
872              is  `method'  (namespace.class:methodname).    Use
873              `Main'  as  method  name to insert a breakpoint on
874              the application's main method.   You  can  use  it
875              also  with  generics,  for example "System.Collec‐
876              tions.Generic.Queue`1:Peek"
877
878       --breakonex
879              Inserts a breakpoint on exceptions.   This  allows
880              you to debug your application with a native debug‐
881              ger when an exception is thrown.
882
883       --compile name
884              This  compiles  a  method  (namespace.name:method‐
885              name),  this is used for testing the compiler per‐
886              formance or to examine the output of the code gen‐
887              erator.
888
889       --compileall
890              Compiles  all the methods in an assembly.  This is
891              used to test the compiler performance or to  exam‐
892              ine the output of the code generator
893
894       --graph=TYPE METHOD
895              This generates a postscript file with a graph with
896              the details about  the  specified  method  (names‐
897              pace.name:methodname).   This  requires  `dot' and
898              ghostview to be installed (it expects Ghostview to
899              be  called "gv").  The following graphs are avail‐
900              able:
901                        cfg        Control Flow Graph (CFG)
902                        dtree      Dominator Tree
903                        code       CFG showing code
904                        ssa        CFG showing code after SSA translation
905                        optcode    CFG showing code after IR optimizations
906              Some graphs will  only  be  available  if  certain
907              optimizations are turned on.
908
909       --ncompile
910              Instruct  the  runtime on the number of times that
911              the method specified  by  --compile  (or  all  the
912              methods  if  --compileall is used) to be compiled.
913              This is used for testing the code  generator  per‐
914              formance.
915
916       --stats
917              Displays  information  about  the work done by the
918              runtime during the execution of an application.
919
920       --wapi=hps|semdel
921              Perform maintenance of the  process  shared  data.
922              semdel will delete the global semaphore.  hps will
923              list the currently used handles.
924
925       -v, --verbose
926              Increases the verbosity level,  each  time  it  is
927              listed,  increases  the verbosity level to include
928              more information (including, for example, a disas‐
929              sembly  of the native code produced, code selector
930              info etc.).
931

ATTACH SUPPORT

933       The Mono runtime allows external processes to attach to a
934       running process and load assemblies into the running pro‐
935       gram.   To attach to the process, a special  protocol  is
936       implemented in the Mono.Management assembly.
937
938       With  this support it is possible to load assemblies that
939       have an entry point (they are created with -target:exe or
940       -target:winexe)  to  be  loaded  and executed in the Mono
941       process.
942
943       The code is loaded into the root domain,  and  it  starts
944       execution  on  the  special runtime attach thread.    The
945       attached program should create its own threads and return
946       after invocation.
947
948       This support allows for example debugging applications by
949       having the csharp shell attach to running processes.
950

PROFILING

952       The Mono runtime includes a profiler API that dynamically
953       loaded  profiler modules and embedders can use to collect
954       performance-related data about an  application.  Profiler
955       modules  are loaded by passing the --profile command line
956       argument to the Mono runtime.
957
958       Mono ships with a few profiler modules, of which the  log
959       profiler is the most feature-rich. It is also the default
960       profiler if the profiler argument is  not  given,  or  if
961       default  is given.  It is possible to write your own pro‐
962       filer modules; see the Custom profilers sub-section.
963
964   Log profiler
965       The log profiler can be used to collect a lot of informa‐
966       tion  about  a  program running in the Mono runtime. This
967       data can be used (both while the process is  running  and
968       later)  to do analyses of the program behavior, determine
969       resource usage, performance issues or even look for  par‐
970       ticular execution patterns.
971
972       This  is  accomplished  by logging the events provided by
973       the Mono runtime through the profiler  API  and  periodi‐
974       cally writing them to a file which can later be inspected
975       with the mprof-report(1) tool.
976
977       More information about how to use  the  log  profiler  is
978       available  on  the  mono-profilers(1) page, under the LOG
979       PROFILER section, as well as the mprof-report(1) page.
980
981   Coverage profiler
982       The code coverage profiler can instrument  a  program  to
983       help  determine  which  classes, methods, code paths, etc
984       are actually executed. This is most useful when running a
985       test  suite to determine whether the tests actually cover
986       the code they're expected to.
987
988       More information about how to use the  coverage  profiler
989       is  available  on  the  mono-profilers(1) page, under the
990       COVERAGE PROFILER section.
991
992   AOT profiler
993       The AOT profiler can help improve startup performance  by
994       logging  which  generic instantiations are used by a pro‐
995       gram, which the AOT compiler  can  then  use  to  compile
996       those  instantiations  ahead  of  time so that they won't
997       have to be JIT compiled at startup.
998
999       More information about how to use  the  AOT  profiler  is
1000       available  on  the  mono-profilers(1) page, under the AOT
1001       PROFILER section.
1002
1003   Custom profilers
1004       Custom profiler modules can be loaded in exactly the same
1005       way as the standard modules that ship with Mono. They can
1006       also access the same profiler API to gather all kinds  of
1007       information about the code being executed.
1008
1009       For example, to use a third-party profiler called custom,
1010       you would load it like this:
1011
1012              mono --profile=custom program.exe
1013
1014       You could also pass arguments to it:
1015
1016              mono --profile=custom:arg1,arg2=arg3 program.exe
1017
1018       In the above example, Mono will load  the  profiler  from
1019       the   shared  library  called  libmono-profiler-custom.so
1020       (name  varies  based  on  platform,  e.g.,   libmono-pro‐
1021       filer-custom.dylib  on  OS X).  This profiler module must
1022       be on your dynamic linker library  path  (LD_LIBRARY_PATH
1023       on most systems, DYLD_LIBRARY_PATH on OS X).
1024
1025       For  a  sample  of how to write your own custom profiler,
1026       look at the samples/profiler/sample.c file  in  the  Mono
1027       source tree.
1028

DEBUGGING AIDS

1030       To  debug  managed applications, you can use the mdb com‐
1031       mand, a command line debugger.
1032
1033       It is possible to obtain a stack trace of all the  active
1034       threads  in  Mono by sending the QUIT signal to Mono, you
1035       can do this from the command line, like this:
1036
1037            kill -QUIT pid
1038
1039       Where pid is the Process ID of the Mono process you  want
1040       to  examine.   The  process  will continue running after‐
1041       wards, but its state is not guaranteed.
1042
1043       Important: this is a last-resort mechanism for  debugging
1044       applications and should not be used to monitor or probe a
1045       production application.  The  integrity  of  the  runtime
1046       after  sending  this  signal  is  not  guaranteed and the
1047       application might crash or terminate at any  given  point
1048       afterwards.
1049
1050       The --debug=casts option can be used to get more detailed
1051       information for Invalid Cast operations, it will  provide
1052       information about the types involved.
1053
1054       You can use the MONO_LOG_LEVEL and MONO_LOG_MASK environ‐
1055       ment variables to get verbose debugging output about  the
1056       execution of your application within Mono.
1057
1058       The  MONO_LOG_LEVEL environment variable if set, the log‐
1059       ging level is changed to the set value.  Possible  values
1060       are  "error",  "critical",  "warning", "message", "info",
1061       "debug". The default value is "error".  Messages  with  a
1062       logging level greater then or equal to the log level will
1063       be printed to stdout/stderr.
1064
1065       Use "info" to track the dynamic loading of assemblies.
1066
1067       Use the MONO_LOG_MASK environment variable to  limit  the
1068       extent  of  the messages you get: If set, the log mask is
1069       changed to the  set  value.  Possible  values  are  "asm"
1070       (assembly loader), "type", "dll" (native library loader),
1071       "gc" (garbage collector),  "cfg"  (config  file  loader),
1072       "aot"  (precompiler),  "security" (e.g. Moonlight CoreCLR
1073       support), "threadpool" (thread pool generic),  "io-selec‐
1074       tor"  (async  socket operations), "io-layer" (I/O layer -
1075       processes, files, sockets,  events,  semaphores,  mutexes
1076       and  handles),  "io-layer-process", "io-layer-file", "io-
1077       layer-socket",  "io-layer-event",   "io-layer-semaphore",
1078       "io-layer-mutex",   "io-layer-handle"   and  "all".   The
1079       default value is "all". Changing the  mask  value  allows
1080       you to display only messages for a certain component. You
1081       can use multiple masks  by  comma  separating  them.  For
1082       example  to  see config file messages and assembly loader
1083       messages set you mask to "asm,cfg".
1084
1085       The following is a common use to track down problems with
1086       P/Invoke:
1087
1088            $ MONO_LOG_LEVEL="debug" MONO_LOG_MASK="dll" mono glue.exe
1089
1090

DEBUGGING WITH LLDB

1092       If  you are using LLDB, you can use the mono.py script to
1093       print some internal data structures  with  it.    To  use
1094       this, add this to your $HOME/.lldbinit file:
1095       command script import $PREFIX/lib/mono/lldb/mono.py
1096
1097       Where  $PREFIX is the prefix value that you used when you
1098       configured Mono (typically /usr).
1099
1100       Once this is done, then you can inspect some Mono Runtime
1101       data structures, for example:
1102       (lldb) p method
1103
1104       (MonoMethod *) $0 = 0x05026ac0 [mscorlib]System.OutOfMemoryException:.ctor()
1105

SERIALIZATION

1107       Mono's  XML  serialization  engine  by default will use a
1108       reflection-based approach to  serialize  which  might  be
1109       slow  for  continuous  processing  (web  service applica‐
1110       tions).  The serialization engine will determine  when  a
1111       class  must  use  a  hand-tuned serializer based on a few
1112       parameters and if needed it will produce a customized  C#
1113       serializer  for  your  types at runtime.  This customized
1114       serializer then gets dynamically loaded into your  appli‐
1115       cation.
1116
1117       You  can  control  this  with  the MONO_XMLSERIALIZER_THS
1118       environment variable.
1119
1120       The possible values are `no' to disable the use of  a  C#
1121       customized  serializer, or an integer that is the minimum
1122       number of uses before the runtime will produce  a  custom
1123       serializer  (0  will  produce  a custom serializer on the
1124       first access, 50 will produce a serializer  on  the  50th
1125       use).  Mono will fallback to an interpreted serializer if
1126       the serializer generation somehow  fails.  This  behavior
1127       can  be  disabled by setting the option `nofallback' (for
1128       example: MONO_XMLSERIALIZER_THS=0,nofallback).
1129

ENVIRONMENT VARIABLES

1131       GC_DONT_GC
1132              Turns off the garbage collection  in  Mono.   This
1133              should be only used for debugging purposes
1134
1135       HTTP_PROXY
1136              (Also  http_proxy)  If set, web requests using the
1137              Mono Class Library will be  automatically  proxied
1138              through  the given URL.  Not supported on Windows,
1139              Mac OS, iOS or Android. See also NO_PROXY.
1140
1141       LLVM_COUNT
1142              When Mono is  compiled  with  LLVM  support,  this
1143              instructs the runtime to stop using LLVM after the
1144              specified number of methods are JITed.  This is  a
1145              tool  used in diagnostics to help isolate problems
1146              in the  code  generation  backend.    For  example
1147              LLVM_COUNT=10  would  only compile 10 methods with
1148              LLVM and then  switch  to  the  Mono  JIT  engine.
1149              LLVM_COUNT=0  would  disable the LLVM engine alto‐
1150              gether.
1151
1152       MONO_ASPNET_INHIBIT_SETTINGSMAP
1153              Mono contains a  feature  which  allows  modifying
1154              settings in the .config files shipped with Mono by
1155              using config section mappers. The mappers and  the
1156              mapping   rules   are   defined   in   the   $pre‐
1157              fix/etc/mono/2.0/settings.map  file  and,  option‐
1158              ally,  in  the settings.map file found in the top-
1159              level directory of your ASP.NET application.  Both
1160              files   are  read  by  System.Web  on  application
1161              startup, if they are found at the above locations.
1162              If  you don't want the mapping to be performed you
1163              can set this variable in your  environment  before
1164              starting  the  application  and  no action will be
1165              taken.
1166
1167       MONO_ASPNET_WEBCONFIG_CACHESIZE
1168              Mono has a  cache  of  ConfigSection  objects  for
1169              speeding  up  WebConfigurationManager queries. Its
1170              default size is 100 items, and when more items are
1171              needed,  cache evictions start happening. If evic‐
1172              tions are too frequent this could impose  unneces‐
1173              sary  overhead,  which  could  be avoided by using
1174              this environment variable to set up a higher cache
1175              size  (or to lower memory requirements by decreas‐
1176              ing it).
1177
1178       MONO_CAIRO_DEBUG_DISPOSE
1179              If set, causes Mono.Cairo to collect stack  traces
1180              when  objects are allocated, so that the finaliza‐
1181              tion/Dispose warnings  include  information  about
1182              the instance's origin.
1183
1184       MONO_CFG_DIR
1185              If set, this variable overrides the default system
1186              configuration directory ($PREFIX/etc).  It's  used
1187              to locate machine.config file.
1188
1189       MONO_COM
1190              Sets  the  style  of COM interop.  If the value of
1191              this  variable  is  "MS"  Mono  will  use   string
1192              marhsalling  routines from the liboleaut32 for the
1193              BSTR type library, any other values will  use  the
1194              mono-builtin BSTR string marshalling.
1195
1196       MONO_CONFIG
1197              If  set,  this variable overrides the default run‐
1198              time configuration file ($PREFIX/etc/mono/config).
1199              The  --config  command  line options overrides the
1200              environment variable.
1201
1202       MONO_CPU_ARCH
1203              Override the automatic  cpu  detection  mechanism.
1204              Currently  used  only  on  arm.  The format of the
1205              value is as follows:
1206
1207                   "armvV [thumb[2]]"
1208
1209              where V is the architecture number 4, 5, 6, 7  and
1210              the   options  can  be  currently  be  "thumb"  or
1211              "thumb2". Example:
1212
1213                   MONO_CPU_ARCH="armv4 thumb" mono ...
1214
1215
1216       MONO_ARM_FORCE_SOFT_FLOAT
1217              When Mono is built with a soft float  fallback  on
1218              ARM  and  this  variable  is set to "1", Mono will
1219              always emit soft float code, even if a VFP unit is
1220              detected.
1221
1222       MONO_DARWIN_USE_KQUEUE_FSW
1223              Fall  back  on the kqueue FileSystemWatcher imple‐
1224              mentation in Darwin. The default  is  the  FSEvent
1225              implementation.
1226
1227       MONO_DARWIN_WATCHER_MAXFDS
1228              This  is  a  debugging aid used to force limits on
1229              the  kqueue  FileSystemWatcher  implementation  in
1230              Darwin.   There is no limit by default.
1231
1232       MONO_DISABLE_MANAGED_COLLATION
1233              If this environment variable is `yes', the runtime
1234              uses unmanaged collation (which actually means  no
1235              culture-sensitive  collation).  It internally dis‐
1236              ables managed collation functionality invoked  via
1237              the  members  of  System.Globalization.CompareInfo
1238              class. Collation is enabled by default.
1239
1240       MONO_DISABLE_SHARED_AREA
1241              Unix only: If set, disable usage of shared  memory
1242              for  exposing  performance counters. This means it
1243              will not be possible to both externally read  per‐
1244              formance  counters  from  this  processes  or read
1245              those of external processes.
1246
1247       MONO_DNS
1248              When set, enables the use of a fully  managed  DNS
1249              resolver  instead  of  the regular libc functions.
1250              This resolver performs much better  when  multiple
1251              queries are run in parallel.
1252
1253              Note that /etc/nsswitch.conf will be ignored.
1254
1255       MONO_EGD_SOCKET
1256              For  platforms that do not otherwise have a way of
1257              obtaining random bytes this can be set to the name
1258              of  a  file system socket on which an egd or prngd
1259              daemon is listening.
1260
1261       MONO_ENABLE_AIO
1262              If set, tells mono to attempt using  native  asyn‐
1263              chronous  I/O  services.  If  not  set,  a default
1264              select/poll  implementation  is  used.   Currently
1265              epoll and kqueue are supported.
1266
1267       MONO_THREADS_SUSPEND
1268              Selects  a mechanism that Mono will use to suspend
1269              threads.  May be set to "preemptive",  "coop",  or
1270              "hybrid".  Threads may need to be suspended by the
1271              debugger, or using some .NET threading  APIs,  and
1272              most  commonly  when  the  SGen  garbage collector
1273              needs to stop all threads during a critical  phase
1274              of  garbage  collection.   Preemptive  mode is the
1275              mode that Mono has used historically,  going  back
1276              to  the  Boehm  days,  where the garbage collector
1277              would run at any point and  suspend  execution  of
1278              all  threads as required to perform a garbage col‐
1279              lection.  The cooperative mode on the  other  hand
1280              requires the cooperation of all threads to stop at
1281              a safe point.  This makes for an easier  to  debug
1282              garbage  collector.  As of Mono 4.3.0 it is a work
1283              in progress, and while it works, it has  not  been
1284              used extensively.  This option enables the feature
1285              and allows us to find spots that need to be  tuned
1286              for this mode of operation.  Hybrid mode is a com‐
1287              bination of the two that retains  better  compata‐
1288              bility  with  scenarios  where Mono is embedded in
1289              another application: threads that are running man‐
1290              aged  code or code that comprises the Mono runtime
1291              will be  cooperatively  suspended,  while  threads
1292              running  embedder  code  will be preemptively sus‐
1293              pended.
1294
1295              Alternatively, coop and hybrid mode can be enabled
1296              at compile time by using the --enable-cooperative-
1297              suspend or --enable-hybrid-suspend flags,  respec‐
1298              tively,     when     calling    configure.     The
1299              MONO_THREADS_SUSPEND  environment  variable  takes
1300              priority over the compiled default.
1301
1302       MONO_ENABLE_COOP_SUSPEND
1303              This   environment   variable   is  obsolete,  but
1304              retained   for   backward   compatibility.     Use
1305              MONO_THREADS_SUSPEND  set to "coop" instead.  Note
1306              that if configure flags were  provided  to  enable
1307              cooperative  or  hybrid  suspend, this variable is
1308              ignored.
1309
1310       MONO_ENV_OPTIONS
1311              This environment variable allows you to pass  com‐
1312              mand  line arguments to a Mono process through the
1313              environment.   This is useful for example to force
1314              all  of  your  Mono  processes to use LLVM or SGEN
1315              without having to modify any launch scripts.
1316
1317       MONO_SDB_ENV_OPTIONS
1318              Used to pass extra options to the  debugger  agent
1319              in the runtime, as they were passed using --debug‐
1320              ger-agent=.
1321
1322       MONO_EVENTLOG_TYPE
1323              Sets the type of event log provider  to  use  (for
1324              System.Diagnostics.EventLog).    Possible   values
1325              are:
1326
1327              local[:path]
1328                     Persists event  logs  and  entries  to  the
1329                     local  file system.  The directory in which
1330                     to persist the event  logs,  event  sources
1331                     and entries can be specified as part of the
1332                     value.  If the path is not explicitly  set,
1333                     it  defaults to "/var/lib/mono/eventlog" on
1334                     unix and "%APPDATA%no\ventlog" on Windows.
1335
1336              win32  Uses the native win32 API to  write  events
1337                     and  registers event logs and event sources
1338                     in the registry.   This is  only  available
1339                     on Windows.  On Unix, the directory permis‐
1340                     sion for individual  event  log  and  event
1341                     source  directories  is set to 777 (with +t
1342                     bit) allowing everyone to  read  and  write
1343                     event   log  entries  while  only  allowing
1344                     entries to be deleted by the  user(s)  that
1345                     created them.
1346
1347              null   Silently discards any events.
1348
1349              The  default  is  "null"  on Unix (and versions of
1350              Windows before NT), and "win32" on Windows NT (and
1351              higher).
1352
1353       MONO_EXTERNAL_ENCODINGS
1354              If  set,  contains  a colon-separated list of text
1355              encodings to try when turning externally-generated
1356              text  (e.g.  command-line  arguments or filenames)
1357              into Unicode.  The encoding names  come  from  the
1358              list  provided  by  iconv,  and  the  special case
1359              "default_locale"  which  refers  to  the   current
1360              locale's default encoding.
1361
1362              When  reading  externally-generated  text  strings
1363              UTF-8 is tried first, and then this list is  tried
1364              in order with the first successful conversion end‐
1365              ing the search.  When writing external text  (e.g.
1366              new  filenames  or arguments to new processes) the
1367              first item in this list is used, or UTF-8  if  the
1368              environment variable is not set.
1369
1370              The  problem with using MONO_EXTERNAL_ENCODINGS to
1371              process your files is that it results in  a  prob‐
1372              lem:  although  its possible to get the right file
1373              name it is not necessarily possible  to  open  the
1374              file.  In general if you have problems with encod‐
1375              ings in your filenames you should use the "convmv"
1376              program.
1377
1378       MONO_GC_PARAMS
1379              When  using  Mono  with the SGen garbage collector
1380              this variable controls several parameters  of  the
1381              collector.   The variable's value is a comma sepa‐
1382              rated list of words.
1383
1384              max-heap-size=size
1385                     Sets the maximum size of the heap. The size
1386                     is  specified  in bytes and must be a power
1387                     of two. The suffixes `k', `m' and  `g'  can
1388                     be  used  to specify kilo-, mega- and giga‐
1389                     bytes, respectively. The limit is  the  sum
1390                     of the nursery, major heap and large object
1391                     heap. Once the limit is reached the  appli‐
1392                     cation  will  receive OutOfMemoryExceptions
1393                     when trying  to  allocate.   Not  the  full
1394                     extent of memory set in max-heap-size could
1395                     be available to satisfy a single allocation
1396                     due  to  internal fragmentation. By default
1397                     heap limits is disabled and the GC will try
1398                     to use all available memory.
1399
1400              nursery-size=size
1401                     Sets  the size of the nursery.  The size is
1402                     specified in bytes and must be a  power  of
1403                     two.   The suffixes `k', `m' and `g' can be
1404                     used to specify kilo-, mega- and gigabytes,
1405                     respectively.   The  nursery  is  the first
1406                     generation (of two).  A larger nursery will
1407                     usually speed up the program but will obvi‐
1408                     ously use more memory.  The default nursery
1409                     size 4 MB.
1410
1411              major=collector
1412                     Specifies  which  major  collector  to use.
1413                     Options are `marksweep' for the  Mark&Sweep
1414                     collector,  `marksweep-conc' for concurrent
1415                     Mark&Sweep  and  `marksweep-conc-par'   for
1416                     parallel  and  concurrent  Mark&Sweep.  The
1417                     concurrent  Mark&Sweep  collector  is   the
1418                     default.
1419
1420              mode=balanced|throughput|pause[:max-pause]
1421                     Specifies  what  should be the garbage col‐
1422                     lector's target. The `throughput' mode aims
1423                     to reduce time spent in the garbage collec‐
1424                     tor  and  improve  application  speed,  the
1425                     `pause'  mode aims to keep pause times to a
1426                     minimum and it receives the  argument  max-
1427                     pause  which  specifies  the  maximum pause
1428                     time in milliseconds that is acceptable and
1429                     the `balanced' mode which is a general pur‐
1430                     pose optimal mode.
1431
1432              soft-heap-limit=size
1433                     Once the heap size gets  larger  than  this
1434                     size, ignore what the default major collec‐
1435                     tion trigger metric  says  and  only  allow
1436                     four  nursery  size's  of major heap growth
1437                     between major collections.
1438
1439              evacuation-threshold=threshold
1440                     Sets the evacuation threshold  in  percent.
1441                     This   option  is  only  available  on  the
1442                     Mark&Sweep  major  collectors.   The  value
1443                     must  be  an integer in the range 0 to 100.
1444                     The default is 66.  If the sweep  phase  of
1445                     the  collection finds that the occupancy of
1446                     a specific heap block  type  is  less  than
1447                     this  percentage, it will do a copying col‐
1448                     lection for that block  type  in  the  next
1449                     major  collection,  thereby restoring occu‐
1450                     pancy to close to 100 percent.  A value  of
1451                     0 turns evacuation off.
1452
1453              (no-)lazy-sweep
1454                     Enables  or  disables  lazy  sweep  for the
1455                     Mark&Sweep  collector.   If  enabled,   the
1456                     sweeping of individual major heap blocks is
1457                     done piecemeal whenever  the  need  arises,
1458                     typically during nursery collections.  Lazy
1459                     sweeping is enabled by default.
1460
1461              (no-)concurrent-sweep
1462                     Enables or disables  concurrent  sweep  for
1463                     the  Mark&Sweep collector.  If enabled, the
1464                     iteration of all major blocks to  determine
1465                     which ones can be freed and which ones have
1466                     to be kept and swept, is done  concurrently
1467                     with   the   running  program.   Concurrent
1468                     sweeping is enabled by default.
1469
1470              stack-mark=mark-mode
1471                     Specifies how application threads should be
1472                     scanned. Options are `precise` and `conser‐
1473                     vative`. Precise marking allow the  collec‐
1474                     tor to know what values on stack are refer‐
1475                     ences and what are not.  Conservative mark‐
1476                     ing  threats all values as potentially ref‐
1477                     erences and leave them  untouched.  Precise
1478                     marking  reduces  floating  garbage and can
1479                     speed up nursery collection and  allocation
1480                     rate,  it  has  the downside of requiring a
1481                     significant  extra  memory   per   compiled
1482                     method.  The  right  option, unfortunately,
1483                     requires experimentation.
1484
1485              save-target-ratio=ratio
1486                     Specifies the target  save  ratio  for  the
1487                     major collector. The collector lets a given
1488                     amount of memory to be  promoted  from  the
1489                     nursery  due to minor collections before it
1490                     triggers a major collection. This amount is
1491                     based  on  how  much  memory  it expects to
1492                     free. It is represented as a ratio  of  the
1493                     size  of the heap after a major collection.
1494                     Valid values are between 0.1 and  2.0.  The
1495                     default  is  0.5.  Smaller values will keep
1496                     the major heap size smaller but will  trig‐
1497                     ger  more major collections. Likewise, big‐
1498                     ger values will use more memory and  result
1499                     in  less  frequent major collections.  This
1500                     option is EXPERIMENTAL, so it might  disap‐
1501                     pear in later versions of mono.
1502
1503              default-allowance-ratio=ratio
1504                     Specifies  the default allocation allowance
1505                     when the calculated size is too small.  The
1506                     allocation allowance is how much memory the
1507                     collector let be promoted before  triggered
1508                     a  major  collection.  It is a ratio of the
1509                     nursery size.  Valid values are between 1.0
1510                     and 10.0. The default is 4.0.  Smaller val‐
1511                     ues lead to smaller heaps and more frequent
1512                     major collections.  Likewise, bigger values
1513                     will allow the heap to grow faster but  use
1514                     more  memory when it reaches a stable size.
1515                     This option is EXPERIMENTAL,  so  it  might
1516                     disappear in later versions of mono.
1517
1518              minor=minor-collector
1519                     Specifies  which  minor  collector  to use.
1520                     Options are  `simple'  which  promotes  all
1521                     objects  from  the  nursery directly to the
1522                     old generation, `simple-par' which has same
1523                     promotion  behavior  as  `simple' but using
1524                     multiple workers  and  `split'  which  lets
1525                     objects  stay  longer on the nursery before
1526                     promoting.
1527
1528              alloc-ratio=ratio
1529                     Specifies the  ratio  of  memory  from  the
1530                     nursery to be use by the alloc space.  This
1531                     only can only be used with the split  minor
1532                     collector.    Valid   values  are  integers
1533                     between 1 and 100. Default is 60.
1534
1535              promotion-age=age
1536                     Specifies the required  age  of  an  object
1537                     must  reach  inside the nursery before been
1538                     promoted to the old generation.  This  only
1539                     can  only be used with the split minor col‐
1540                     lector.  Valid values are integers  between
1541                     1 and 14. Default is 2.
1542
1543              (no-)cementing
1544                     Enables  or  disables  cementing.  This can
1545                     dramatically  shorten  nursery   collection
1546                     times   on  some  benchmarks  where  pinned
1547                     objects are  referred  to  from  the  major
1548                     heap.
1549
1550              allow-synchronous-major
1551                     This  forbids the major collector from per‐
1552                     forming synchronous major collections.  The
1553                     major collector might want to do a synchro‐
1554                     nous collection due to excessive fragmenta‐
1555                     tion.  Disabling  this  might  trigger Out‐
1556                     OfMemory error  in  situations  that  would
1557                     otherwise not happen.
1558
1559       MONO_GC_DEBUG
1560              When  using  Mono  with the SGen garbage collector
1561              this environment variable can be used to  turn  on
1562              various  debugging features of the collector.  The
1563              value of this variable is a comma  separated  list
1564              of words.  Do not use these options in production.
1565
1566              number Sets  the debug level to the specified num‐
1567                     ber.
1568
1569              print-allowance
1570                     After each major collection  prints  memory
1571                     consumption  for  before and after the col‐
1572                     lection and the  allowance  for  the  minor
1573                     collector,   i.e.  how  much  the  heap  is
1574                     allowed  to  grow  from  minor  collections
1575                     before  the  next major collection is trig‐
1576                     gered.
1577
1578              print-pinning
1579                     Gathers statistics  on  the  classes  whose
1580                     objects  are  pinned in the nursery and for
1581                     which  global  remset  entries  are  added.
1582                     Prints those statistics when shutting down.
1583
1584              collect-before-allocs
1585
1586              check-remset-consistency
1587                     This performs a remset consistency check at
1588                     various opportunities, and also clears  the
1589                     nursery  at collection time, instead of the
1590                     default, when buffers are allocated (clear-
1591                     at-gc).  The consistency check ensures that
1592                     there are no major to minor references that
1593                     are not on the remembered sets.
1594
1595              mod-union-consistency-check
1596                     Checks that the mod-union cardtable is con‐
1597                     sistent before each finishing major collec‐
1598                     tion  pause.  This check is only applicable
1599                     to concurrent major collectors.
1600
1601              check-mark-bits
1602                     Checks that mark bits in the major heap are
1603                     consistent at the end of each major collec‐
1604                     tion.  Consistent mark bits mean that if an
1605                     object  is  marked, all objects that it had
1606                     references to must also be marked.
1607
1608              check-nursery-pinned
1609                     After  nursery  collections,   and   before
1610                     starting   concurrent   collections,  check
1611                     whether all nursery objects are pinned,  or
1612                     not  pinned  -  depending on context.  Does
1613                     nothing when the split nursery collector is
1614                     used.
1615
1616              xdomain-checks
1617                     Performs  a check to make sure that no ref‐
1618                     erences are left to an unloaded AppDomain.
1619
1620              clear-at-tlab-creation
1621                     Clears the nursery incrementally  when  the
1622                     thread  local allocation buffers (TLAB) are
1623                     created.  The default  setting  clears  the
1624                     whole nursery at GC time.
1625
1626              debug-clear-at-tlab-creation
1627                     Clears  the  nursery incrementally when the
1628                     thread local allocation buffers (TLAB)  are
1629                     created,  but  at GC time fills it with the
1630                     byte `0xff`, which should result in a crash
1631                     more  quickly  if  `clear-at-tlab-creation`
1632                     doesn't work properly.
1633
1634              clear-at-gc
1635                     This clears the nursery at GC time  instead
1636                     of  doing  it when the thread local alloca‐
1637                     tion buffer (TLAB) is created.  The default
1638                     is  to  clear  the nursery at TLAB creation
1639                     time.
1640
1641              disable-minor
1642                     Don't do minor collections.  If the nursery
1643                     is  full,  a  major collection is triggered
1644                     instead, unless it, too, is disabled.
1645
1646              disable-major
1647                     Don't do major collections.
1648
1649              conservative-stack-mark
1650                     Forces the GC to scan the  stack  conserva‐
1651                     tively,  even if precise scanning is avail‐
1652                     able.
1653
1654              no-managed-allocator
1655                     Disables the managed allocator.
1656
1657              check-scan-starts
1658                     If set, does a plausibility  check  on  the
1659                     scan_starts  before  and after each collec‐
1660                     tion
1661
1662              verify-nursery-at-minor-gc
1663                     If set, does a complete object walk of  the
1664                     nursery  at the start of each minor collec‐
1665                     tion.
1666
1667              dump-nursery-at-minor-gc
1668                     If set, dumps the contents of  the  nursery
1669                     at  the  start  of  each  minor collection.
1670                     Requires verify-nursery-at-minor-gc  to  be
1671                     set.
1672
1673              heap-dump=file
1674                     Dumps  the  heap  contents to the specified
1675                     file.   To visualize the  information,  use
1676                     the mono-heapviz tool.
1677
1678              binary-protocol=file
1679                     Outputs  the debugging output to the speci‐
1680                     fied file.   For this to work,  Mono  needs
1681                     to  be  compiled  with  the BINARY_PROTOCOL
1682                     define on sgen-gc.c.    You  can  then  use
1683                     this command to explore the output
1684                                     sgen-grep-binprot 0x1234 0x5678 < file
1685
1686              nursery-canaries
1687                     If  set,  objects  allocated in the nursery
1688                     are suffixed with a  canary  (guard)  word,
1689                     which  is checked on each minor collection.
1690                     Can be used to detect/debug heap corruption
1691                     issues.
1692
1693
1694              do-not-finalize(=classes)
1695                     If  enabled,  finalizers  will  not be run.
1696                     Everything else will be unaffected:  final‐
1697                     izable  objects  will still be put into the
1698                     finalization queue where they survive until
1699                     they're   scheduled   to   finalize.   Once
1700                     they're not in the queue anymore they  will
1701                     be  collected  regularly.   If  a  list  of
1702                     comma-separated class names is given,  only
1703                     objects  from  those  classes  will  not be
1704                     finalized.
1705
1706
1707              log-finalizers
1708                     Log  verbosely  around   the   finalization
1709                     process to aid debugging.
1710
1711       MONO_GAC_PREFIX
1712              Provides  a  prefix  the  runtime uses to look for
1713              Global Assembly Caches.  Directories are separated
1714              by  the  platform path separator (colons on unix).
1715              MONO_GAC_PREFIX should point to the top  directory
1716              of  a  prefixed  install. Or to the directory pro‐
1717              vided in the  gacutil  /gacdir  command.  Example:
1718              /home/username/.mono:/usr/local/mono/
1719
1720       MONO_IOMAP
1721              Enables  some filename rewriting support to assist
1722              badly-written applications that hard-code  Windows
1723              paths.   Set  to a colon-separated list of "drive"
1724              to strip drive letters,  or  "case"  to  do  case-
1725              insensitive  file matching in every directory in a
1726              path.   "all"  enables  all   rewriting   methods.
1727              (Backslashes  are always mapped to slashes if this
1728              variable is set to a valid option).
1729              For example, this would work from the shell:
1730
1731                   MONO_IOMAP=drive:case
1732                   export MONO_IOMAP
1733
1734              If you are using mod_mono to host your web  appli‐
1735              cations,  you  can  use  the  MonoIOMAP  directive
1736              instead, like this:
1737
1738                   MonoIOMAP <appalias> all
1739
1740              See mod_mono(8) for more details.
1741
1742       MONO_LLVM
1743              When Mono is using the LLVM code generation  back‐
1744              end  you can use this environment variable to pass
1745              code generation options to the LLVM compiler.
1746
1747       MONO_MANAGED_WATCHER
1748              If set to "disabled",  System.IO.FileSystemWatcher
1749              will  use  a  file  watcher  implementation  which
1750              silently ignores all the  watching  requests.   If
1751              set   to   any   other  value,  System.IO.FileSys‐
1752              temWatcher will use the default managed  implemen‐
1753              tation (slow). If unset, mono will try to use ino‐
1754              tify, FAM, Gamin, kevent under  Unix  systems  and
1755              native  API  calls on Windows, falling back to the
1756              managed implementation on error.
1757
1758       MONO_MESSAGING_PROVIDER
1759              Mono supports a plugin model for  its  implementa‐
1760              tion  of  System.Messaging  making  it possible to
1761              support a  variety  of  messaging  implementations
1762              (e.g. AMQP, ActiveMQ).  To specify which messaging
1763              implementation is to be used the evironement vari‐
1764              able  needs  to  be set to the full class name for
1765              the provider.  E.g. to use the RabbitMQ based AMQP
1766              implementation the variable should be set to:
1767
1768              Mono.Messaging.RabbitMQ.RabbitMQMessagingProvider,Mono.Messaging.RabbitMQ
1769
1770       MONO_NO_SMP
1771              If set causes the mono process to be bound to a single processor. This may be
1772              useful when debugging or working around race conditions.
1773
1774       MONO_NO_TLS
1775              Disable inlining of thread local accesses. Try setting this if you get a segfault
1776              early on in the execution of mono.
1777
1778       MONO_PATH
1779              Provides a search path to the runtime where to look for library
1780              files.   This is a tool convenient for debugging applications, but
1781              should not be used by deployed applications as it breaks the assembly
1782              loader in subtle ways.
1783              Directories are separated by the platform path separator (colons on unix). Example:
1784              /home/username/lib:/usr/local/mono/lib
1785              Relative paths are resolved based on the launch-time current directory.
1786              Alternative solutions to MONO_PATH include: installing libraries into
1787              the Global Assembly Cache (see gacutil(1)) or having the dependent
1788              libraries side-by-side with the main executable.
1789              For a complete description of recommended practices for application
1790              deployment, see
1791              http://www.mono-project.com/docs/getting-started/application-deployment/
1792
1793       MONO_SHARED_DIR
1794              If set its the directory where the ".wapi" handle state is stored.
1795              This is the directory where the Windows I/O Emulation layer stores its
1796              shared state data (files, events, mutexes, pipes).  By default Mono
1797              will store the ".wapi" directory in the users's home directory.
1798
1799       MONO_SHARED_HOSTNAME
1800              Uses the string value of this variable as a replacement for the host name when
1801              creating file names in the ".wapi" directory. This helps if the host name of
1802              your machine is likely to be changed when a mono application is running or if
1803              you have a .wapi directory shared among several different computers.
1804              Mono typically uses the hostname to create the files that are used to
1805              share state across multiple Mono processes.  This is done to support
1806              home directories that might be shared over the network.
1807
1808       MONO_STRICT_IO_EMULATION
1809              If set, extra checks are made during IO operations.  Currently, this
1810              includes only advisory locks around file writes.
1811
1812       MONO_TLS_SESSION_CACHE_TIMEOUT
1813              The time, in seconds, that the SSL/TLS session cache will keep it's entry to
1814              avoid a new negotiation between the client and a server. Negotiation are very
1815              CPU intensive so an application-specific custom value may prove useful for
1816              small embedded systems.
1817              The default is 180 seconds.
1818
1819       MONO_THREADS_PER_CPU
1820              The minimum number of threads in the general threadpool will be
1821              MONO_THREADS_PER_CPU * number of CPUs. The default value for this
1822              variable is 1.
1823
1824       MONO_XMLSERIALIZER_THS
1825              Controls the threshold for the XmlSerializer to produce a custom
1826              serializer for a given class instead of using the Reflection-based
1827              interpreter.  The possible values are `no' to disable the use of a
1828              custom serializer or a number to indicate when the XmlSerializer
1829              should start serializing.   The default value is 50, which means that
1830              the a custom serializer will be produced on the 50th use.
1831
1832       MONO_X509_REVOCATION_MODE
1833              Sets the revocation mode used when validating a X509 certificate chain (https,
1834              ftps, smtps...).  The default is 'nocheck', which performs no revocation check
1835              at all. The other possible values are 'offline', which performs CRL check (not
1836              implemented yet) and 'online' which uses OCSP and CRL to verify the revocation
1837              status (not implemented yet).
1838
1839       NO_PROXY
1840              (Also no_proxy) If both HTTP_PROXY and NO_PROXY are
1841              set, NO_PROXY will be treated as a comma-separated list of "bypass" domains
1842              which will not be sent through the proxy. Domains in NO_PROXY may contain
1843              wildcards, as in "*.mono-project.com" or "build????.local". Not supported on
1844              Windows, Mac OS, iOS or Android.
1845

ENVIRONMENT VARIABLES FOR DEBUGGING

1847       MONO_ASPNET_NODELETE
1848              If set to any value, temporary source files gener‐
1849              ated  by  ASP.NET  support  classes  will  not  be
1850              removed. They will be kept in the user's temporary
1851              directory.
1852
1853       MONO_DEBUG
1854              If set, enables some features of the runtime  use‐
1855              ful for debugging.  This variable should contain a
1856              comma separated list of debugging  options.   Cur‐
1857              rently, the following options are supported:
1858
1859              align-small-structs
1860                     Enables  small  structs  alignment  to  4/8
1861                     bytes.
1862
1863              arm-use-fallback-tls
1864                     When this option is set on ARM, a  fallback
1865                     thread  local store will be used instead of
1866                     the default fast thread local storage prim‐
1867                     itives.
1868
1869              break-on-unverified
1870                     If  this  variable is set, when the Mono VM
1871                     runs into a verification  problem,  instead
1872                     of throwing an exception it will break into
1873                     the debugger.  This is useful  when  debug‐
1874                     ging verifier problems
1875
1876              casts  This   option  can  be  used  to  get  more
1877                     detailed   information   from   InvalidCast
1878                     exceptions,  it  will  provide  information
1879                     about the types involved.
1880
1881              check-pinvoke-callconv
1882                     This option causes the runtime to check for
1883                     calling  convention  mismatches  when using
1884                     pinvoke, i.e. mixing cdecl/stdcall. It only
1885                     works   on   windows.   If  a  mismatch  is
1886                     detected,  an  ExecutionEngineException  is
1887                     thrown.
1888
1889              collect-pagefault-stats
1890                     Collects   information   about  pagefaults.
1891                     This is used internally to track the number
1892                     of  page  faults produced to load metadata.
1893                     To display this information  you  must  use
1894                     this  option  with  "--stats"  command line
1895                     option.
1896
1897              debug-domain-unload
1898                     When this option is set, the  runtime  will
1899                     invalidate  the  domain memory pool instead
1900                     of destroying it.
1901
1902              disable_omit_fp
1903                     Disables a compiler optimization where  the
1904                     frame  pointer  is  omitted from the stack.
1905                     This optimization can interact  badly  with
1906                     debuggers.
1907
1908              dont-free-domains
1909                     This is an Optimization for multi-AppDomain
1910                     applications (most commonly ASP.NET  appli‐
1911                     cations).    Due  to  internal  limitations
1912                     Mono, Mono by default does  not  use  typed
1913                     allocations on multi-appDomain applications
1914                     as they could leak memory when a domain  is
1915                     unloaded.  Although this is a fine default,
1916                     for applications that use more than on App‐
1917                     Domain heavily (for example, ASP.NET appli‐
1918                     cations) it is worth trading off the  small
1919                     leaks  for the increased performance (addi‐
1920                     tionally, since  ASP.NET  applications  are
1921                     not  likely going to unload the application
1922                     domains on production systems, it is  worth
1923                     using this feature).
1924
1925              dyn-runtime-invoke
1926                     Instructs  the  runtime  to  try  to  use a
1927                     generic runtime-invoke wrapper  instead  of
1928                     creating one invoke wrapper.
1929
1930              explicit-null-checks
1931                     Makes  the  JIT  generate  an explicit NULL
1932                     check on variable dereferences  instead  of
1933                     depending  on the operating system to raise
1934                     a SIGSEGV or another  form  of  trap  event
1935                     when   an   invalid   memory   location  is
1936                     accessed.
1937
1938              gdb    Equivalent to setting the MONO_XDEBUG vari‐
1939                     able,  this  emits  symbols  into  a shared
1940                     library as the code is JITed  that  can  be
1941                     loaded into GDB to inspect symbols.
1942
1943              gen-seq-points
1944                     Automatically   generates  sequence  points
1945                     where the IL stack  is  empty.   These  are
1946                     places  where the debugger can set a break‐
1947                     point.
1948
1949              no-compact-seq-points
1950                     Unless the option is used, the runtime gen‐
1951                     erates   sequence  points  data  that  maps
1952                     native  offsets  to  IL  offsets.  Sequence
1953                     point  data is used to display IL offset in
1954                     stacktraces. Stacktraces  with  IL  offsets
1955                     can  be symbolicated using mono-symbolicate
1956                     tool.
1957
1958              handle-sigint
1959                     Captures the interrupt  signal  (Control-C)
1960                     and  displays  a  stack trace when pressed.
1961                     Useful to find out  where  the  program  is
1962                     executing at a given point.  This only dis‐
1963                     plays the stack trace of a single thread.
1964
1965              init-stacks
1966                     Instructs the  runtime  to  initialize  the
1967                     stack  with  some  known  values  (0x2a  on
1968                     x86-64) at the start of a method to  assist
1969                     in debuggin the JIT engine.
1970
1971              keep-delegates
1972                     This  option will leak delegate trampolines
1973                     that are no longer referenced as to present
1974                     the user with more information about a del‐
1975                     egate   misuse.    Basically   a   delegate
1976                     instance might be created, passed to unman‐
1977                     aged code, and no references kept  in  man‐
1978                     aged  code,  which will garbage collect the
1979                     code.  With this option it is  possible  to
1980                     track down the source of the problems.
1981
1982              no-gdb-backtrace
1983                     This  option will disable the GDB backtrace
1984                     emitted by the runtime after a  SIGSEGV  or
1985                     SIGABRT in unmanaged code.
1986
1987              partial-sharing
1988                     When  this  option  is set, the runtime can
1989                     share generated code between generic  types
1990                     effectively  reducing  the  amount  of code
1991                     generated.
1992
1993              reverse-pinvoke-exceptions
1994                     This option will cause mono to abort with a
1995                     descriptive   message   when  during  stack
1996                     unwinding after an exception it  reaches  a
1997                     native  stack  frame.  This  happens when a
1998                     managed delegate is passed to native  code,
1999                     and  the  managed delegate throws an excep‐
2000                     tion. Mono will normally try to unwind  the
2001                     stack to the first (managed) exception han‐
2002                     dler, and it will  skip  any  native  stack
2003                     frames  in the process. This leads to unde‐
2004                     fined behaviour (since  mono  doesn't  know
2005                     how  to  process native frames), leaks, and
2006                     possibly crashes too.
2007
2008              single-imm-size
2009                     This guarantees that each time managed code
2010                     is  compiled the same instructions and reg‐
2011                     isters are used, regardless of the size  of
2012                     used values.
2013
2014              soft-breakpoints
2015                     This  option  allows using single-steps and
2016                     breakpoints in hardware where we cannot  do
2017                     it with signals.
2018
2019              suspend-on-native-crash
2020                     This option will suspend the program when a
2021                     native crash occurs (SIGSEGV, SIGILL, ...).
2022                     This  is useful for debugging crashes which
2023                     do not  happen  under  gdb,  since  a  live
2024                     process  contains  more  information than a
2025                     core file.
2026
2027              suspend-on-sigsegv
2028                     Same as suspend-on-native-crash.
2029
2030              suspend-on-exception
2031                     This option will suspend the  program  when
2032                     an exception occurs.
2033
2034              suspend-on-unhandled
2035                     This  option  will suspend the program when
2036                     an unhandled exception occurs.
2037
2038              thread-dump-dir=DIR
2039                     Use DIR for storage thread dumps created by
2040                     SIGQUIT.
2041
2042              verbose-gdb
2043                     Make gdb output on native crashes more ver‐
2044                     bose.
2045
2046       MONO_LOG_LEVEL
2047              The logging level, possible  values  are  `error',
2048              `critical',   `warning',   `message',  `info'  and
2049              `debug'.   See  the  DEBUGGING  section  for  more
2050              details.
2051
2052       MONO_LOG_MASK
2053              Controls  the domain of the Mono runtime that log‐
2054              ging will apply to.   If  set,  the  log  mask  is
2055              changed  to  the  set  value.  Possible values are
2056              "asm" (assembly  loader),  "type",  "dll"  (native
2057              library  loader),  "gc" (garbage collector), "cfg"
2058              (config file loader), "aot" (precompiler),  "secu‐
2059              rity"  (e.g. Moonlight CoreCLR support) and "all".
2060              The default value  is  "all".  Changing  the  mask
2061              value  allows  you  to display only messages for a
2062              certain component. You can use multiple  masks  by
2063              comma  separating  them. For example to see config
2064              file messages and assembly loader messages set you
2065              mask to "asm,cfg".
2066
2067       MONO_LOG_DEST
2068              Controls  where trace log messages are written. If
2069              not set then the messages go to stdout.   If  set,
2070              the  string either specifies a path to a file that
2071              will have messages appended to it, or  the  string
2072              "syslog"  in which case the messages will be writ‐
2073              ten to the system log.   Under  Windows,  this  is
2074              simulated  by writing to a file called "mono.log".
2075              MONO_LOG_HEADER Controls whether  trace  log  mes‐
2076              sages  not  directed  to syslog have the id, time‐
2077              stamp, and pid as the prefix to the  log  message.
2078              To  enable a header this environment variable need
2079              just be non-null.
2080
2081       MONO_TRACE
2082              Used for runtime tracing of method calls. The for‐
2083              mat of the comma separated trace options is:
2084
2085                   [-]M:method name
2086                   [-]N:namespace
2087                   [-]T:class name
2088                   [-]all
2089                   [-]program
2090                   disabled       Trace output off upon start.
2091
2092              You  can  toggle  trace  output  on/off  sending a
2093              SIGUSR2 signal to the program.
2094
2095       MONO_TRACE_LISTENER
2096              If set,  enables  the  System.Diagnostics.Default‐
2097              TraceListener,  which will print the output of the
2098              System.Diagnostics Trace and  Debug  classes.   It
2099              can  be  set  to a filename, and to Console.Out or
2100              Console.Error to display output to standard output
2101              or  standard  error,  respectively. If it's set to
2102              Console.Out or Console.Error  you  can  append  an
2103              optional  prefix  that  will  be used when writing
2104              messages like  this:  Console.Error:MyProgramName.
2105              See   the  System.Diagnostics.DefaultTraceListener
2106              documentation for more information.
2107
2108       MONO_WCF_TRACE
2109              This eases WCF diagnostics functionality by simply
2110              outputs  all log messages from WCF engine to "std‐
2111              out", "stderr" or any file passed to this environ‐
2112              ment variable. The log format is the same as usual
2113              diagnostic output.
2114
2115       MONO_XEXCEPTIONS
2116              This throws an  exception  when  a  X11  error  is
2117              encountered; by default a message is displayed but
2118              execution continues
2119
2120       MONO_XMLSERIALIZER_DEBUG
2121              Set this value to 1 to prevent the serializer from
2122              removing  the temporary files that are created for
2123              fast serialization;  This  might  be  useful  when
2124              debugging.
2125
2126       MONO_XSYNC
2127              This is used in the System.Windows.Forms implemen‐
2128              tation when running with the X11 backend.  This is
2129              used  to  debug  problems  in  Windows.Forms as it
2130              forces all of the commands send to X11  server  to
2131              be done synchronously.   The default mode of oper‐
2132              ation is asynchronous which makes it hard to  iso‐
2133              late the root of certain problems.
2134
2135       MONO_XDEBUG
2136              When the the MONO_XDEBUG env var is set, debugging
2137              info for JITted code  is  emitted  into  a  shared
2138              library,  loadable  into  gdb.  This  enables, for
2139              example, to see managed frame names on  gdb  back‐
2140              traces.
2141
2142       MONO_VERBOSE_METHOD
2143              Enables  the  maximum JIT verbosity for the speci‐
2144              fied method. This is very helpfull to  diagnose  a
2145              miscompilation  problems  of  a  specific  method.
2146              This can be a semicolon-separated list  of  method
2147              names  to  match.   If  the  name  is simple, this
2148              applies to any method with  that  name,  otherwise
2149              you  can  use  a  mono method description (see the
2150              section METHOD DESCRIPTIONS).
2151
2152       MONO_JIT_DUMP_METHOD
2153              Enables sending of the JITs intermediate represen‐
2154              tation for a specified method to the IdealGraphVi‐
2155              sualizer tool.
2156
2157       MONO_VERBOSE_HWCAP
2158              If set, makes the  JIT  output  information  about
2159              detected  CPU  features (such as SSE, CMOV, FCMOV,
2160              etc) to stdout.
2161
2162       MONO_CONSERVATIVE_HWCAP
2163              If set, the JIT  will  not  perform  any  hardware
2164              capability  detection.  This may be useful to pin‐
2165              point the cause of JIT issues. This is the default
2166              when  Mono  is  built as an AOT cross compiler, so
2167              that the generated code will run on most hardware.
2168

VALGRIND

2170       If you want to use  Valgrind,  you  will  find  the  file
2171       `mono.supp'  useful, it contains the suppressions for the
2172       GC which trigger incorrect warnings.  Use it like this:
2173           valgrind --suppressions=mono.supp mono ...
2174

DTRACE

2176       On some platforms, Mono can expose a set of DTrace probes
2177       (also   known   as  user-land  statically  defined,  USDT
2178       Probes).
2179
2180       They are defined in the file `mono.d'.
2181
2182       ves-init-begin, ves-init-end
2183              Begin and end of runtime initialization.
2184
2185       method-compile-begin, method-compile-end
2186              Begin and end of method  compilation.   The  probe
2187              arguments  are  class name, method name and signa‐
2188              ture, and in case of method-compile-end success or
2189              failure of compilation.
2190
2191       gc-begin, gc-end
2192              Begin and end of Garbage Collection.
2193
2194       To verify the availability of the probes, run:
2195                  dtrace -P mono'$target' -l -c mono
2196

PERMISSIONS

2198       Mono's  Ping implementation for detecting network reacha‐
2199       bility can create the ICMP packets itself without requir‐
2200       ing  the system ping command to do the work.  If you want
2201       to enable this on Linux for non-root users, you  need  to
2202       give the Mono binary special permissions.
2203
2204       As root, run this command:
2205          # setcap cap_net_raw=+ep /usr/bin/mono
2206

FILES

2208       On  Unix  assemblies are loaded from the installation lib
2209       directory.  If you set `prefix' to /usr,  the  assemblies
2210       will  be located in /usr/lib.  On Windows, the assemblies
2211       are loaded from the directory where mono and mint live.
2212
2213       ~/.mono/aot-cache
2214              The  directory  for  the  ahead-of-time   compiler
2215              demand creation assemblies are located.
2216
2217       /etc/mono/config, ~/.mono/config
2218              Mono  runtime  configuration  file.  See the mono-
2219              config(5) manual page for more information.
2220
2221       ~/.config/.mono/certs, /usr/share/.mono/certs
2222              Contains  Mono  certificate  stores  for  users  /
2223              machine.  See  the certmgr(1) manual page for more
2224              information on managing certificate stores and the
2225              mozroots(1)  page for information on how to import
2226              the Mozilla root certificates into the  Mono  cer‐
2227              tificate store.
2228
2229       ~/.mono/assemblies/ASSEMBLY/ASSEMBLY.config
2230              Files  in this directory allow a user to customize
2231              the configuration for a given system assembly, the
2232              format  is the one described in the mono-config(5)
2233              page.
2234
2235       ~/.config/.mono/keypairs, /usr/share/.mono/keypairs
2236              Contains Mono cryptographic keypairs for  users  /
2237              machine. They can be accessed by using a CspParam‐
2238              eters  object  with  DSACryptoServiceProvider  and
2239              RSACryptoServiceProvider classes.
2240
2241       ~/.config/.isolatedstorage, ~/.local/share/.isolatedstor‐
2242       age, /usr/share/.isolatedstorage
2243              Contains Mono  isolated  storage  for  non-roaming
2244              users,  roaming  users and local machine. Isolated
2245              storage can be accessed using the classes from the
2246              System.IO.IsolatedStorage namespace.
2247
2248       <assembly>.config
2249              Configuration  information  for  individual assem‐
2250              blies is loaded by the runtime  from  side-by-side
2251              files    with   the   .config   files,   see   the
2252              http://www.mono-project.com/Config for more infor‐
2253              mation.
2254
2255       Web.config, web.config
2256              ASP.NET  applications are configured through these
2257              files, the configuration is done on  a  per-direc‐
2258              tory  basis.  For more information on this subject
2259              see  the   http://www.mono-project.com/Config_sys
2260              tem.web page.
2261

MAILING LISTS

2263       Mailing   lists   are   listed  at  the  http://www.mono-
2264       project.com/community/help/mailing-lists/
2265

WEB SITE

2267       http://www.mono-project.com
2268

SEE ALSO

2270       certmgr(1), cert-sync(1), csharp(1), gacutil(1),  mcs(1),
2271       monodis(1),       mono-config(5),      mono-profilers(1),
2272       mprof-report(1), pdb2mdb(1), xsp(1), mod_mono(8)
2273
2274       For   more   information   on    AOT:    http://www.mono-
2275       project.com/docs/advanced/aot/
2276
2277       For  ASP.NET-related documentation, see the xsp(1) manual
2278       page
2279
2280
2281
2282                                                                    Mono(mono)
Impressum