Andrew said:
Is it possible to use reflection to look at a method's implementation?
I would like to know which other methods the method in question might
call.
Any quick pointers to references appreciated.
As others have said, in 1.1 it is not possible with th framework, but in
..NET 2.0 it is possible with the MethodBody class.
In 1.1 I have done it with the unmanaged metadata API in unmanaged code.
It is possible to call that API through platform invoke, but it would be
messy.
The reason why I wanted to get the methods called by methods was because
I wanted to see whether the .NET framework library is a mere wrapper
around Win32 and get an idea of how this changes with .NET version.
So I measured how many methods there are, how many method calls are made
to managed code in the assembly and managed code in another assembly,
how many are through platform invoke, how many are made to COM objects
and how many method calls are internalcall (which is an unmanaged
implementation provided by the runtime). I have the raw data for various
versions, but I haven't finished analysing it... If you are interested
in the result, watch my home page for an announcement sometime.
Richard