如何使用reflector查看.NET库函数的实现

发布于 2024-07-29 06:24:29 字数 253 浏览 2 评论 0原文

我试图查看 [MethodImpl(MethodImplOptions.InternalCall)] 的实现 public extern int get_Length(); 函数,它又是字符串的 Length 属性。

但 Reflector 给了我以下错误:

该成员未加载或可能由于您的可见性设置而被隐藏

但是该成员已加载且可见性设置为“全部”

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

旧故 2024-08-05 06:24:29

我相信外部方法是“通常”使用其他 DLL 实现的方法,大多数是本机的。 当然,在这种情况下,您就脱离了反射地盘!

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!

久伴你 2024-08-05 06:24:29

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

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文