How I can get IL code of C# code ? Can I do this with a extern library, or exists internal functions ?
EDIT : I want to show IL code in my application with a MessageBox.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Programmatically? You can use reflection to get a
MethodInfo, and then callMethodBase.GetMethodBodyto get the body. From theMethodBody, you can callGetILAsByteArrayamongst other things.Of course, if you just want to examine it yourself, there’s Reflector, dotPeek, ildasm (part of the .NET SDK) and no doubt other tools…