Appendix D - IL Assembler and Disassembler Command-Line Options

Appendix D

IL Assembler and Disassembler Command-Line Options

IL Assembler

The command-line structure of IL Assembler is as follows:

ilasm [<options><sourcefile> [<options>][<sourcefile>*]

The default source file extension is IL. Multiple source files are parsed in the order of their appearance on the command line. Because options do not need to appear in a prescribed order, options and names of source files can be intermixed. All options specified on the command line are pertinent to the entire set of source files.

All options are recognized by the first three characters following the option key, and all are case-insensitive. The option key can be a forward slash (/) or a hyphen (-). In options that specify parameters, the equality character (=) is interchangeable with the colon character (:). The following option notations are equivalent:

/OUTPUT=MyModule.dll

-OUTPUT:MyModule.dll

/out:MyModule.dll

-Outp:MyModule.dll

The following command-line options are defined for IL Assembler:

  • /LISTING  Type a formatted listing of the compilation result.

  • /NOLOGO  Suppress typing the logo and copyright statement.

  • /QUIET  Suppress reporting the compilation progress.

  • /DLL  Compile to a dynamic-link library.

  • /EXE  Compile to a runnable executable (the default).

  • /DEBUG  Include debug information and create a program database (PDB) file.

  • /CLOCK  Measure and report the compilation times.

  • /RESOURCE=<res_file>  Link the specified unmanaged resource file (*.res) into the resulting PE file. <res_file> must be a full filename, including the extension.

  • /OUTPUT=<targetfile>  Compile to the file whose name is specified. The file extension must be specified explicitly; there is no default. If this option is omitted, IL Assembler sets the name of the output file to that of the first source file and sets the extension of the output file to DLL if the /DLL option is specified and to EXE otherwise.

  • /KEY=<keyfile>  Compile with a strong name signature. <keyfile> specifies the file containing the private encryption key.

  • /KEY=@<keysource>  Compile with a strong name signature. <keysource> specifies the name of the source of the private encryption key.

  • /SUBSYSTEM=<int>  Set the Subsystem value in the PE header. The most frequently used <int> values are 3 (Microsoft Windows console application) and 2 (Microsoft Windows GUI application).

  • /FLAGS=<int>  Set the Flags value in the common language runtime header. The most frequently used <int> values are 1 (pure-IL code) and 2 (mixed code). The third bit of the <int> value, indicating that the PE file is strong name signed, is ignored.

  • /ALIGNMENT=<int>  Set the FileAlignment value in the PE header. The <int> value must be a power of 2, in the range 512 to 65536.

  • /BASE=<int>  Set the ImageBase value in the PE header.

  • /ERROR  Attempt to create the PE file even if compilation errors have been reported.

  • Using the /ERROR option does not guarantee that the PE file will be created: some errors are abortive, and others lead specifically to a failure to create the PE file. This option also disables the following IL Assembler autocorrection features:

    • An unsealed value type is marked sealed.

    • A method declared as both static and instance is marked static.

    • A nonabstract, nonvirtual instance method of an interface is marked abstract and virtual.

    • A global abstract method is marked nonabstract.

    • Nonstatic global fields and methods are marked static.

    warning

    Don’t use the /ERROR command-line option unless you’re positive that you know what you’re doing. It is very dangerous! You can create a monster that will crash your system.



Inside Microsoft. NET IL Assembler
Inside Microsoft .NET IL Assembler
ISBN: 0735615470
EAN: 2147483647
Year: 2005
Pages: 147
Authors: SERGE LIDIN

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net