Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting IL to C# code

Tags:

c#

.net

I need to convert the IL to c# code. I have an assembly and I am reading this assembly. I get MethodBody from MethodInfo and the methodbody has a method GetILAsByteArraY() which returns a byte array now I want to convert this IL to C# code. Please help me out in solving this.

like image 823
Embedd_0913 Avatar asked Mar 15 '09 16:03

Embedd_0913


2 Answers

Don't reinvent the wheel; use Lutz Roeder's .NET Reflector.

like image 107
jason Avatar answered Oct 07 '22 02:10

jason


The Lutz Roeder reflector was purchased and is no longer available for free download.

There is now a free (once again) tool called ILSpy. I've found it to be very good, and it will not only generate C# code from IL but will also create a .csproj project if decompiling an entire DLL assembly.

like image 26
DuckMaestro Avatar answered Oct 07 '22 01:10

DuckMaestro