lundi 10 juillet 2017

Get DefaultConstructor of Class RuntimeMethodInfo

I'm want to get default Constructor of Class RuntimeMethodInfo by such a code

Assembly assembly = Assembly.Load("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089");
Type type = assembly.GetType("System.Reflection.RuntimeMethodInfo");
        var defaultConstructor = type.GetConstructor(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance, null, Type.EmptyTypes, null);
var defaultConstructor = type.GetConstructor(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance, null, Type.EmptyTypes, null);

but defaultConstructor value is null. I need default constrcutor in deserialization of json to instatnsiate object so can fill it.





Aucun commentaire:

Enregistrer un commentaire