tags:

views:

343

answers:

4

Hi, 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?

+2  A: 

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?)

Brian
mmm I use it on a project and it works...Where could be the code? :P
Federico Degrandis
A: 

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?

Jason Haley
It's using Micro Framework 4.0 and there isn't any IL :(
Federico Degrandis
My guess is, Red Gate hasn't finished that code yet. If you aren't using a pre-release of Reflector you might try it (http://www.red-gate.com/MessageBoard/viewforum.php?f=109)
Jason Haley
A: 

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.

leppie
+4  A: 

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. read more here: http://mokosh.co.uk/post/2010/06/05/net-reflector-showing-empty-implementation/

If that is the case than you can use this plugin to get path to the actual assembly with implementation.

jarek
This is the answer. The metadata only versions reside under "Reference Assemblies" under program files. You have to open the versions in windows\microsoft.net\framework\....
Will