-
Hey friends! I looked online, and it was suggested to use ICSharpCode.Decompiler.Ast.AstBuilder to do it, but it seems like this class no longer exist. So is there a replacement for it? tbh there are few documentation and up to date example to it, which sucks. It would be best to decompile a single method call (which should be possible considering how ILSpy displays c# code and IL code together), but I'll accept decompiling an entire method too. Any ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You can decompile a single method using |
Beta Was this translation helpful? Give feedback.
class AstBuilder
was replaced byclass CSharpDecompiler
in ILSpy 3.0.You can decompile a single method using
CSharpDecompiler.Decompile()
, passing in theMethodDefinitionHandle
.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