DynamicMethod does not hold parameter names


#1

Hi,

Is it possible to get some information or hints to understand the DynamicMethods a little bit better?

My current problem: I compile a LambdaExpression with a set of named parameters. But if I want to access the parameter name via delegate.Method.GetParameters[n].Name later, I get null. The reason is, that DynamicMethod only holds the types not the meta information.

Is there a plan to hold the information, or is it impossible?

In addition, I try to find out, what the corefx is doing, to understand all a little bit more. But I only find a empty declaration of DynamicMethod. What does this mean?


#2

I can only answer the second part, some types are in run time’s mscorlib sources in the coreclr repository.

mscorlib holds types that are directly implemented over the run time or the type system for example , int , float, delegate etc and related functions of these types.
corefx uses a concept called reference assemblies that are actually empty and type forward to the implementations in mscorlib. But in the new model ms want to get rid of this architecture so type forwarding/reference assemblies are minimizing.

Still some types may exist in mscorlib but would not be accessible when using coreclr that is because those types were deprecated from the new coreclr/corefx implementation. And because coreclr shares source code with Microsoft’s desktop clr those types exist for desktop and are not exposed from any corefx assemblies.


#3

Thanks for the information. I understand the “ref” folder, now. And also find the implementation.

It looks simular to the Full Framework implementation :disappointed:.

Hopefully, someone can say something to the question:
Is there a plan to hold the information, or is it impossible?


.NET Foundation Website | Blog | Projects | Code of Conduct