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

NAME

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

SYNOPSIS

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

DESCRIPTION

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

DEVELOPMENT OPTIONS

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

JIT MAINTAINER OPTIONS

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

ATTACH SUPPORT

916       The Mono runtime allows external processes to attach to a
917       running process and load assemblies into the running pro‐
918       gram.   To attach to the process, a special  protocol  is
919       implemented in the Mono.Management assembly.
920
921       With  this support it is possible to load assemblies that
922       have an entry point (they are created with -target:exe or
923       -target:winexe)  to  be  loaded  and executed in the Mono
924       process.
925
926       The code is loaded into the root domain,  and  it  starts
927       execution  on  the  special runtime attach thread.    The
928       attached program should create its own threads and return
929       after invocation.
930
931       This support allows for example debugging applications by
932       having the csharp shell attach to running processes.
933

PROFILING

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

DEBUGGING AIDS

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

DEBUGGING WITH LLDB

1075       If  you are using LLDB, you can use the mono.py script to
1076       print some internal data structures  with  it.    To  use
1077       this, add this to your $HOME/.lldbinit file:
1078       command script import $PREFIX/lib/mono/lldb/mono.py
1079
1080       Where  $PREFIX is the prefix value that you used when you
1081       configured Mono (typically /usr).
1082
1083       Once this is done, then you can inspect some Mono Runtime
1084       data structures, for example:
1085       (lldb) p method
1086
1087       (MonoMethod *) $0 = 0x05026ac0 [mscorlib]System.OutOfMemoryException:.ctor()
1088

SERIALIZATION

1090       Mono's  XML  serialization  engine  by default will use a
1091       reflection-based approach to  serialize  which  might  be
1092       slow  for  continuous  processing  (web  service applica‐
1093       tions).  The serialization engine will determine  when  a
1094       class  must  use  a  hand-tuned serializer based on a few
1095       parameters and if needed it will produce a customized  C#
1096       serializer  for  your  types at runtime.  This customized
1097       serializer then gets dynamically loaded into your  appli‐
1098       cation.
1099
1100       You  can  control  this  with  the MONO_XMLSERIALIZER_THS
1101       environment variable.
1102
1103       The possible values are `no' to disable the use of  a  C#
1104       customized  serializer, or an integer that is the minimum
1105       number of uses before the runtime will produce  a  custom
1106       serializer  (0  will  produce  a custom serializer on the
1107       first access, 50 will produce a serializer  on  the  50th
1108       use).  Mono will fallback to an interpreted serializer if
1109       the serializer generation somehow  fails.  This  behavior
1110       can  be  disabled by setting the option `nofallback' (for
1111       example: MONO_XMLSERIALIZER_THS=0,nofallback).
1112

ENVIRONMENT VARIABLES

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

ENVIRONMENT VARIABLES FOR DEBUGGING

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

VALGRIND

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

DTRACE

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

PERMISSIONS

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

FILES

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

MAILING LISTS

2266       Mailing   lists   are   listed  at  the  http://www.mono-
2267       project.com/community/help/mailing-lists/
2268

WEB SITE

2270       http://www.mono-project.com
2271

SEE ALSO

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