For example, you can use the following format to create a demo. genericssimple <t, tt> instance by Using Reflection:
System. reflection. assembly. getexecutingassembly (). createinstance ("namespace. user 'parameter quantity N [[full name of the 1-type parameter, name of the Cheng set of the type of the parameter], [full name of the 2-type parameter, assembly name of the type of the parameter], [3. Full name of the parameter type, name of the Assembly where the parameter type is located] ...... n] ")
Code:
Namespace demo {public class genericssimple <t, tt> where T: class where TT: struct {} class program {static void main (string [] ARGs) {var o = system. reflection. assembly. getexecutingassembly (). createinstance ("demo. genericssimple '2 [[system. string, mscorlib], [system. int32, mscorlib] "); console. writeline ("{0}", O = NULL? "Null": O. GetType (). fullname); console. writeline ("=== end ="); console. Read ();}}}