tags:

views:

442

answers:

2

I tried to see the implementation of [MethodImpl(MethodImplOptions.InternalCall)] public extern int get_Length(); fucntion, which in turn is Length property of string.

But reflector gave me the following error "The member is not loaded or may be hidden due to your visibility settings"

However the member is loaded and the visibility settings is ALL

+1  A: 

I belive the extern methods are the ones that are "typically" implemented using other DLLs, mostly native ones. And of course, when that is the case you are out of the reflection turf!

Charles Prakash Dasari
How can I then see its implementation?
Learner
Simple answer - you can't see the implementation at the level what you see when you reflect .NET code. However, you might be able to disassemble the DLL and try to make sense out of the assembly instructions - but I wouldn't go there. What do you want to achieve anyway?
Charles Prakash Dasari
A: 

Certain very important types like String have many methods that are implemented using native code. The Length property of String is one such example. This can also be seen from the extern modifier. Reflector cannot show you the implementation of these methods.

Martin Liversage
How can I then see its implementation?
Learner
You can't within "Reflector", because this code is not anymore IL code. Its native assembly code, that you have to disassemble with other non .net tools... Note: With the "PeID" tool you can see in which language an application was written http://www.peid.info/
Peter Gfader