ILSpy: our changes to an open source project
A .NET decompiler: it turns compiled assemblies back into readable C# code.
- Language
- C#
- GitHub stars
- 26,543
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.
- Pull request #4232merged on 11 October 2026
- Pull request #4133merged on 19 September 2026
Remove the delegate cache left by a discarded method-group conversion
github.com/icsharpcode/ILSpy/pull/4133 - Pull request #4134merged on 15 September 2026
Recognize a VB exception filter's type test
github.com/icsharpcode/ILSpy/pull/4134
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.
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.
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.
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.
Read next
More about this work and the other projects with our changes.
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.