Hello,
With reflection, is it a way to get (in managed code) the IL Code of a
method ?
I would like to retrieve for a Method, all the called inner Method.
I know how to Emit IL Code in assembly, but I can't find the reverse
possibility.
The only think I have found is the MethodHandle function of MethodInfo
class, that theorically return the metadata, but I can't find a way to go
further.
Thanks. 3 3354
Ludovic,
In .NET 2.0, you will be able to call the GetMethodBody method on the
MethodInfo instance and get a MethodBody instance which will allow you
access to the IL as a byte array.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Ludovic DE FREITAS" <Lu**************@discussions.microsoft.com> wrote in
message news:1F**********************************@microsof t.com... Hello,
With reflection, is it a way to get (in managed code) the IL Code of a method ? I would like to retrieve for a Method, all the called inner Method.
I know how to Emit IL Code in assembly, but I can't find the reverse possibility. The only think I have found is the MethodHandle function of MethodInfo class, that theorically return the metadata, but I can't find a way to go further.
Thanks.
Thanks for this response.
Unfortunatly, I work on .Net 1.1.
Is it a way to retrieve this byte array by another way ?
Thanks.
"Nicholas Paldino [.NET/C# MVP]" wrote: Ludovic,
In .NET 2.0, you will be able to call the GetMethodBody method on the MethodInfo instance and get a MethodBody instance which will allow you access to the IL as a byte array.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Ludovic DE FREITAS" <Lu**************@discussions.microsoft.com> wrote in message news:1F**********************************@microsof t.com... Hello,
With reflection, is it a way to get (in managed code) the IL Code of a method ? I would like to retrieve for a Method, all the called inner Method.
I know how to Emit IL Code in assembly, but I can't find the reverse possibility. The only think I have found is the MethodHandle function of MethodInfo class, that theorically return the metadata, but I can't find a way to go further.
Thanks.
Ludovic,
Unfortunately, without opening up the assembly yourself and parsing
through it, I don't know if there is a way to get the body of the method.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Ludovic DE FREITAS" <Lu**************@discussions.microsoft.com> wrote in
message news:78**********************************@microsof t.com... Thanks for this response.
Unfortunatly, I work on .Net 1.1. Is it a way to retrieve this byte array by another way ?
Thanks.
"Nicholas Paldino [.NET/C# MVP]" wrote:
Ludovic,
In .NET 2.0, you will be able to call the GetMethodBody method on the MethodInfo instance and get a MethodBody instance which will allow you access to the IL as a byte array.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Ludovic DE FREITAS" <Lu**************@discussions.microsoft.com> wrote in message news:1F**********************************@microsof t.com... > Hello, > > With reflection, is it a way to get (in managed code) the IL Code of a > method ? > I would like to retrieve for a Method, all the called inner Method. > > I know how to Emit IL Code in assembly, but I can't find the reverse > possibility. > The only think I have found is the MethodHandle function of MethodInfo > class, that theorically return the metadata, but I can't find a way to > go > further. > > Thanks. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Eyal |
last post by:
Hey,
I would appriciate if anyone can help on this one:
I have a java object/inteface having a method with a boolean
parameter. As I'm trying to call this method from a javascript it
fails on...
|
by: Martin Raychev |
last post by:
Hi all,
I have the following problem:
I have a private method that returns a SqlDataReader. For this to work I
have not to close the DB connection in the above method. I do this only to
|
by: Steve |
last post by:
Hi All,
I have a Python script that uses SOAPpy and I'm outputting all of the
methods and info about the parameters... I'm having trouble getting
information out of the __init__ parameter.
...
|
by: Archana |
last post by:
Hi all,
I am having application where i am downloading xml content using
webrequest. my code is as below
HttpWebRequest lWebRequest = (HttpWebRequest) WebRequest.Create(URL);
HttpWebResponse...
|
by: JamesB |
last post by:
I am writing a service that monitors when a particular app is started.
Works, but I need to get the user who is currently logged in, and of course
Environment.UserName returns the service logon...
|
by: banderson777 |
last post by:
Hello,
I'm a bit new at in-depth IE programming, and am having a bit of trouble with a couple of IE browser extensions (getting them to talk to each other).
The first one is a C++ Browser Helper...
|
by: Heshan Suri |
last post by:
Hi,
I have written a the following python code to analyse a function or a method. I am having a script which is having a python function (add) and a class (MyClass) with a method (multiply).When...
|
by: vikas251074 |
last post by:
I am getting error while entry in userid field. When user enter his user id, an event is fired immediately and user id is verified using AJAX method. But I am getting error 'Object doesn't support...
|
by: AnuSumesh |
last post by:
Hi all,
I am writing one application using c# in which firstly I m getting impersonating the user and then i want to retrieve mapped Drives.
But issue is when I am calling method in following...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |