Skip to content

Getting started

Andreas Weizel edited this page Mar 4, 2025 · 5 revisions

Installation

Install ILSpy extension from Visual Studio Marketplace. On installation Visual Studio Code might ask to additionally install .NET Install Tool for Extension Authors, which is by design and intended.

On first start a .NET runtime is automatically downloaded in the background. This is necessary to access ILSpy decompilation engine.

Download of .NET Runtime

The runtime is installed into a local VS Code directory and doesn't alter your system. There is one exception: On Linux systems this process might also install some dependencies of the runtime, which could involve adding/updating some packages.

Usage

After successful start you will see new "ILSpy" commands in VS Code's Command Palette (Ctrl+Shift+P):

ILSpy in Command Palette

You can either select an assembly file present in your workspace or choose any assembly file on your system. After selection the assembly will be shown in a new Explorer view "ILSpy: Assemblies":

Assembly Tree

The tree view allows to explore the namespaces, members and types of the assembly. Click on an item will decompile the member on-demand and show it's C# or MSIL code in an editor view.

Choosing Output Language

You may choose different output languages for decompilation output, either different generations of C#, or direct IL code.

With an active decompilation view click the output language button in status bar:

Output Language Status Bar Button

Then a list of available languages and language generations opens. Choose the one you like, the active decompilation view updates immediately.

Output Language List

Output language can also be changed globally in VS Code settings:

Output Language Setting

Auto-loaded Dependencies in Assembly Tree

When viewing assemblies and their types and members, the extension might need to load additional assemblies to properly resolve types from dependencies. This usually happens in the background, but if the "Auto-load Dependencies" setting is active (default), those additional dependencies are also shown in assembly tree with blue color:

Auto-load Dependencies Setting

Auto-load Assemblies in Assembly Tree

This behavior is similar to ILSpy desktop application, apart from one detail: They are shown only temporarily and will disappear again after restart, even if the assembly list itself is persisted.

Clone this wiki locally