D.3 MSIL Assembler (ilasm.exe)

This tool takes MSIL as input and generates a portable executable (PE) file containing the MSIL and the metadata required to run on the .NET Framework. This is most useful to vendors who would like to create MSIL-compliant compilers. All they have to do is write the compiler to translate the source language to MSIL. Ilsam.exe will take the second step to put the MSIL content into the PE format where it can be executed on the .NET Framework. The general syntax for MSIL assembler is:

ilasm [options] MSILfilename

Table D-3 shows some of the common uses of the assemblers.

Table D-3. Assemblers common uses




This option ensures that the output PE contains debugging information such as local variables, argument names, and line numbers. This is useful for debug build.


This option produces a .dll output.


This option produces an .exe output.


This option produces a listing of the output on STDOUT.


filename is the output filename.


This option is used to obtain command-line help.