OS Manuals

/usr/bin/ilspycmd

ICSharpCode.ILSpy command-line decompiler for .NET assemblies (raw IL and C

From ilspycmd 11.2-r0 (os), captured 2026-11-05 by running ilspycmd --help (exit 0). permalink

ilspycmd: 11.2.0.0
ICSharpCode.Decompiler: 11.2.0.0

dotnet tool for decompiling .NET assemblies and generating portable PDBs

Usage: ilspycmd [options] <Assembly file name(s)>

Arguments:
  Assembly file name(s)                   The list of assemblies that is being
                                          decompiled. This argument is
                                          mandatory.

Options:
  -v|--version                            Show version of ICSharpCode.Decompiler
                                          used.
  -h|--help                               Show help information.
  -o|--outputdir <directory>              The output directory, if omitted
                                          decompiler output is written to
                                          standard out.
  -p|--project                            Decompile assembly as compilable
                                          project. This requires the output
                                          directory option.
  -t|--type <type-name>                   The fully qualified name of the type
                                          to decompile.
  -m|--member <doc-id-or-token>           The single member to decompile: an XML
                                          documentation id string (e.g.
                                          "M:System.String.Concat(System.String,System.String)",
                                          as also accepted by the UI's
                                          --navigateto option) or a metadata
                                          token (e.g. 0x06000005).
  -il|--ilcode                            Show IL code.
  --il-sequence-points                    Show IL with sequence points. Implies
                                          -il.
  -genpdb|--generate-pdb                  Generate PDB.
  -usepdb|--use-varnames-from-pdb         Use variable names from PDB.
  -l|--list <entity-type(s)>              Lists all entities of the specified
                                          type(s). Valid types: c(lass),
                                          i(nterface), s(truct), d(elegate),
                                          e(num)
  --list-resources                        Lists all embedded resources in the
                                          assembly. Entries inside .resources
                                          containers are listed individually as
                                          '<container>/<entry>'.
  --resource <name>                       Extract a single resource by name (as
                                          printed by --list-resources).
                                          Resources whose name ends with '.baml'
                                          are decompiled to XAML.
  --decompile-baml                        Deprecated: -p decompiles BAML
                                          resources to XAML files (Page items)
                                          on its own. Accepted so that existing
                                          scripts keep working.
  --dump-table <table>                    Dump a metadata table: prints RID,
                                          token, names, heap offsets and coded
                                          indexes of every row. <table> is the
                                          ECMA-335 table name (e.g. TypeDef,
                                          Property, MethodSemantics;
                                          case-insensitive) or table number
                                          (decimal or 0x-prefixed hex, e.g.
                                          0x17).
  --dump-pdb                              Dump the debug information of the
                                          assembly's PDB: documents, per-method
                                          sequence points, the scope tree with
                                          its variables, constants and imports,
                                          and custom debug information. Reads
                                          both Portable and Windows PDBs. Use
                                          -usepdb:<file> to point at a PDB that
                                          is not next to the assembly.
  --json                                  Output as JSON. Only supported
                                          together with --dump-table or
                                          --dump-pdb.
  -lv|--languageversion <version>         C# Language version: CSharp1, CSharp2,
                                          CSharp3, CSharp4, CSharp5, CSharp6,
                                          CSharp7, CSharp7_1, CSharp7_2,
                                          CSharp7_3, CSharp8_0, CSharp9_0,
                                          CSharp10_0, CSharp11_0, CSharp12_0,
                                          CSharp13_0, Preview or Latest
                                          Allowed values are: CSharp1, CSharp2,
                                          CSharp3, CSharp4, CSharp5, CSharp6,
                                          CSharp7, CSharp7_1, CSharp7_2,
                                          CSharp7_3, CSharp8_0, CSharp9_0,
                                          CSharp10_0, CSharp11_0, CSharp12_0,
                                          CSharp13_0, CSharp14_0, CSharp15_0,
                                          Preview, Latest.
                                          Default value is: Latest.
  --ilspy-settingsfile <path>             Path to an ILSpy settings file.
  -ds|--decompiler-setting <value>        Set a decompiler setting. Use multiple
                                          times to set multiple settings.
  -r|--referencepath <path>               Path to a directory containing
                                          dependencies of the assembly that is
                                          being decompiled.
  --ignore-decompilation-errors           Exit with success even when parts of
                                          the assembly could not be decompiled.
                                          The affected code carries the error
                                          text in the output and the failures
                                          are listed on stderr either way; only
                                          the exit status changes.
  --no-dead-code                          Remove dead code.
  --no-dead-stores                        Remove dead stores.
  -d|--dump-package                       Dump package assemblies into a folder.
                                          This requires the output directory
                                          option.
  --bundle-entry <name>                   The assembly inside a single-file
                                          bundle (or other package) to work on,
                                          as printed when such a file is passed
                                          without this option. Ignored for input
                                          files that are not packages.
  --nested-directories                    Use nested directories for namespaces.
  --disable-updatecheck                   If using ilspycmd in a tight loop or
                                          fully automated scenario, you might
                                          want to disable the automatic update
                                          check.
  --generate-diagrammer                   Generates an interactive HTML
                                          diagrammer app from selected types in
                                          the target assembly - to the
                                          --outputdir or in a 'diagrammer'
                                          folder next to to the assembly by
                                          default.
  --generate-diagrammer-include           An optional regular expression
                                          matching Type.FullName used to
                                          whitelist types to include in the
                                          generated diagrammer.
  --generate-diagrammer-exclude           An optional regular expression
                                          matching Type.FullName used to
                                          blacklist types to exclude from the
                                          generated diagrammer.
  --generate-diagrammer-report-excluded   Outputs a report of types excluded
                                          from the generated diagrammer -
                                          whether by default because
                                          compiler-generated, explicitly by
                                          '--generate-diagrammer-exclude' or
                                          implicitly by
                                          '--generate-diagrammer-include'. You
                                          may find this useful to develop and
                                          debug your regular expressions.
  --generate-diagrammer-docs              The path or file:// URI of the XML
                                          file containing the target assembly's
                                          documentation comments. You only need
                                          to set this if a) you want your
                                          diagrams annotated with them and b)
                                          the file name differs from that of the
                                          assembly. To enable XML documentation
                                          output for your assembly, see
                                          https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/xmldoc/#create-xml-documentation-output
  --generate-diagrammer-strip-namespaces  Optional space-separated namespace
                                          names that are removed for brevity
                                          from XML documentation comments. Note
                                          that the order matters: e.g. replace
                                          'System.Collections' before 'System'
                                          to remove both of them completely.

Remarks:
  -o is valid with every option and required when using -p or -d.

Examples:
    Decompile assembly to console out.
        ilspycmd sample.dll

    Decompile assembly to destination directory (single C# file).
        ilspycmd -o c:\decompiled sample.dll

    Decompile assembly to destination directory, create a project file, one source file per type.
        ilspycmd -p -o c:\decompiled sample.dll

    Decompile assembly to destination directory, create a project file, one source file per type,
    into nicely nested directories.
        ilspycmd --nested-directories -p -o c:\decompiled sample.dll

    Generate a HTML diagrammer containing all type info into a folder next to the input assembly
        ilspycmd sample.dll --generate-diagrammer

    Generate a HTML diagrammer containing filtered type info into a custom output folder
    (including types in the LightJson namespace while excluding types in nested LightJson.Serialization namespace)
        ilspycmd sample.dll --generate-diagrammer -o c:\diagrammer --generate-diagrammer-include LightJson\\..+ --generate-diagrammer-exclude LightJson\\.Serialization\\..+

    List all embedded resources in a WPF assembly (including BAML entries inside .g.resources containers).
        ilspycmd sample.dll --list-resources

    Extract a single resource. If the name ends with .baml, the output is decompiled XAML; otherwise raw bytes.
        ilspycmd sample.dll --resource sample.g.resources/mainwindow.baml -o c:\decompiled

    Decompile assembly as a compilable project. BAML resources become XAML Page items.
        ilspycmd sample.dll -p -o c:\decompiled
Options (20)
OptionDescriptionSource
--il-sequence-pointsShow IL with sequence points.help
--list-resourcesLists all embedded resources in the assembly.help
--resource nameExtract a single resource by name (as printed by --list-resources).help
--decompile-bamlDeprecated: -p decompiles BAML resources to XAML files (Page items) on its own.help
--dump-table tableDump a metadata table: prints RID, token, names, heap offsets and coded indexes of every row.help
--dump-pdbDump the debug information of the assembly's PDB: documents, per-method sequence points, the scope tree with its variables, constants and imports, and custom debug information.help
--jsonOutput as JSON.help
--ilspy-settingsfile pathPath to an ILSpy settings file.help
--ignore-decompilation-errorsExit with success even when parts of the assembly could not be decompiled.help
--no-dead-codeRemove dead code.help
--no-dead-storesRemove dead stores.help
--bundle-entry nameThe assembly inside a single-file bundle (or other package) to work on, as printed when such a file is passed without this option.help
--nested-directoriesUse nested directories for namespaces.help
--disable-updatecheckIf using ilspycmd in a tight loop or fully automated scenario, you might want to disable the automatic update check.help
--generate-diagrammerGenerates an interactive HTML diagrammer app from selected types in the target assembly - to thehelp
--generate-diagrammer-includeAn optional regular expression matching Type.FullName used to whitelist types to include in the generated diagrammer.help
--generate-diagrammer-excludeAn optional regular expression matching Type.FullName used to blacklist types to exclude from the generated diagrammer.help
--generate-diagrammer-report-excludedOutputs a report of types excluded from the generated diagrammer - whether by default because compiler-generated, explicitly by '--generate-diagrammer-exclude' or implicitly by…help
--generate-diagrammer-docsThe path or file:// URI of the XML file containing the target assembly's documentation comments.help
--generate-diagrammer-strip-namespacesOptional space-separated namespace names that are removed for brevity from XML documentation comments.help

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.