VulCode

ILSpy: our changes to an open source project

A .NET decompiler: it turns compiled assemblies back into readable C# code.

All contributions
Language
C#
GitHub stars
26,543
3merged changes
From 15 Sep 2026 to 11 Oct 2026.
Number 3 of the 64 GitHub projects with our changes, by stars. First is Zed (91,587).

The changes merged into ILSpy

The decompiler no longer leaves a delegate cache field behind after a discarded method-group conversion, and it recognises a VB exception filter's type test.

How we tested #4133

We added an Issue3965 test case with nine scenarios: a single discarded conversion, a conversion before and after a use of the same method, several conversions in a row, two to the same method, and conversions inside a condition and a loop. Each has its expected output written out, and the test compares the decompiled result against it.

C# and .NET

Our projects in this technology, their screens and when we choose it.

The bug, the fix and the lesson

A summary of our Tech news write-up: what was broken, what we changed and what it means for our own work.

What was broken

Decompiled code kept the delegate cache field

With _ = (Action<int>)M; the delegate is created and discarded at once, so the cache field is never read. The pattern did not match, the output kept a field named <>O.<0>__M and the code did not compile.

What we changed

The delegate construction instead of the cache check

When the cache field has no reads, the check is replaced by the delegate construction it guarded. The output is new Action<int>(M);, which compiles and does the same.

What it taught us

A decompiler has to recognise the patterns a compiler emits, or it leaves optimisation debris in the code.

Each fix meant reading exactly what the C# and VB compilers emit.

Other projects with our changes: C# and .NET

7 projects in this technology have our merged changes. The bar is the repository's stars, next to it the number of our changes. Each row leads to the project's page.

Questions about our changes to ILSpy

Where these changes come from, who merged them and whether we can fix something in your library.

Using ILSpy in your project?

If something in it does not work, we fix it at the source and leave a workaround until the release. We reply within an hour.