Reflector不显示类实现

发布于 2024-08-11 23:28:18 字数 147 浏览 1 评论 0原文

我正在尝试反编译一个库,但是当我单击类名或方法名时,实现代码为空。

例如:

public bool MethodOne(string str)
{
    // nothing
}

它可能是什么?

I'm trying to decompile a library but when I click on a class name or a method name, the implementation code is empty.

For example:

public bool MethodOne(string str)
{
    // nothing
}

What could it be?

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

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

发布评论

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

评论(4

你列表最软的妹 2024-08-18 23:28:18

您可能试图反映 Visual Studio 使用的参考程序集来提供多目标支持。这些程序集仅包含元数据,没有任何实际实现。

如果是这种情况,您可以使用 VSCommands 2010 扩展 获取实际程序集的实现路径。

程序集详细信息 http://vscommands.com/wp-content/uploads/ 2011/04/image12.png

You may be trying to reflect reference assemblies used by Visual Studio to provide multi-targeting support. These assemblies are metadata-only and don't have any actual implementation.

If that is the case than you can use VSCommands 2010 extension to get path to the actual assembly with implementation.

assembly details http://vscommands.com/wp-content/uploads/2011/04/image12.png

梦纸 2024-08-18 23:28:18

您可能打开了其中没有代码的参考程序集或 PIA。

方法体实际上可以是空的。

(还有其他的可能性吗?)

You might have opened a Reference Assembly or a PIA that doesn't have code in it.

The method body could actually be empty.

(Other possibilities?)

月牙弯弯 2024-08-18 23:28:18

我在 VSSDK 程序集中也看到过这种情况。

它可能是一个公共提供的接口库,但实际的实现“隐藏”在某个地方。 (也许在 GAC 中?)

基本思路是:

  1. 针对某些“存根”程序集编译代码
  2. 当在应用程序中加载时,存根程序集未解析,但实际的存根程序集

我建议您在调试器中放置一个断点,然后查看实际加载的程序集是什么以及它是从哪里加载的。

I have seen this with the VSSDK assemblies too.

It could be a public provided interface library, but the actual implementation is 'hidden' somewhere. (Maybe in the GAC?)

The basic train of thought is:

  1. Compile code against some 'stub' assembly
  2. When loaded in the application, the stub assembly is not resolved, but the actual one

I suggest you place a breakpoint in the debugger, and see what is the actual loaded assembly and where it is loaded from.

信愁 2024-08-18 23:28:18

它使用什么版本的 .Net 框架? .net 4.0 程序集似乎存在一些问题,会发生这种情况......或者论坛中的一些人是这么说的:Reflector Forum

有IL吗?

What version of the .Net framwork is it using? There seems to be some issue with .net 4.0 assemblies where this happens ... or that is what some people in the forums are saying: Reflector Forum

Is there any IL?

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