Type type1=Type.GetType({namespace.classname}{assemblyname}) //string valueType type =typeof(namespace.class name);//class name
If I put both of this together then the type1 loads the value but when only line 1 is run then type1 value is null, even they both are two separate variables It’s a strange issue
I need to use activator and invoke method class and method with a string
I don't know if I understand your question. It seems like you're looking for information on how to use
System.Activator. It always helps when you're asking a question if you can provide as much code, context, and clarity as possible to help guide people in giving an answer to your question. Please consider spending some time looking through the instructions and examples in Microsoft's documentation.I wrote a couple of lines of sample code to illustrate that Activator can accept parameters following the
Typeargument. The code illustrates that thePersonobject can be created through the constructor that requires a string parameter by adding that argument after thetypeof(Person)argument inActivator.CreateInstance. Hopefully this helps somewhat.