Learner
Learner

Reputation: 2546

How to use reflector to view the implementation of .NET library functions

I tried to see the implementation of [MethodImpl(MethodImplOptions.InternalCall)] public extern int get_Length(); function, 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

Upvotes: 1

Views: 2825

Answers (2)

Martin Liversage
Martin Liversage

Reputation: 106906

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.

Upvotes: 1

Charles Prakash Dasari
Charles Prakash Dasari

Reputation: 5122

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!

Upvotes: 2

Related Questions