2

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

4

2 回答 2

2

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!

于 2009-07-18T20:53:12.880 回答
1

某些非常重要的类型,例如String有许多使用本机代码实现的方法。的Length属性String就是这样一个例子。这也可以从extern修饰符中看出。Reflector 无法向您展示这些方法的实现。

于 2009-07-18T20:54:52.750 回答