Skip to content

Is there a way to decompile a single function/method call? #2226

Answered by dgrunwald
compasslg asked this question in Help
Discussion options

You must be logged in to vote

class AstBuilder was replaced by class CSharpDecompiler in ILSpy 3.0.

You can decompile a single method using CSharpDecompiler.Decompile(), passing in the MethodDefinitionHandle.
The "C# with IL" view works by decompiling the whole method, generating sequence points (debug information) for the decompiled code; and then using those sequence points to map the generated statements back to the IL instructions.
https://github.com/icsharpcode/ILSpy/blob/master/ILSpy/Languages/CSharpILMixedLanguage.cs

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@compasslg
Comment options

@dgrunwald
Comment options

Answer selected by compasslg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants