System.Reflection - Global methods aren't available for reflection

Posted by mrjoltcola on Stack Overflow See other posts from Stack Overflow or by mrjoltcola
Published on 2010-04-22T21:36:27Z Indexed on 2010/04/22 21:43 UTC
Read the original article Hit count: 568

Filed under:
|
|

I have an issue with a semantic gap between the CLR and System.Reflection.

System.Reflection does not (AFAIK) support reflecting on global methods in an assembly. At the assembly level, I must start with the root types.

My compiler can produce assemblies with global methods, and my standard bootstrap lib is a dll that includes some global methods. My compiler uses System.Reflection to import assembly metadata at compile time. It seems if I depend on System.Reflection, global methods are not a possibility. The cleanest solution is to convert all of my standard methods to class static methods, but the point is, my language allows global methods, and the CLR supports it, but System.Reflection leaves a gap.

ildasm shows the global methods just fine, but I assume it does not use System.Reflection itself and goes right to the metadata and bytecode.

Besides System.Reflection, is anyone aware of any other 3rd party reflection or disassembly libs that I could make use of (assuming I will eventually release my compiler as free, BSD licensed open source).

© Stack Overflow or respective owner

Related posts about clr

Related posts about .NET