Can someone explain Activator.CreateInstance() purpose in detail?
Can someone explain Activator.CreateInstance() purpose in detail?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Say you have a class called
MyFancyObjectlike this one below:It lets you turn:
Into
Using
and can then do stuff like:
That’s its purpose. It also has many other overloads such as providing a
Typeinstead of the class name in a string. Why you would have a problem like that is a different story. Here’s some people who needed it: