I have a class :
Class MyClass
{
...
}
I need to get the type of the class in order to use it in reflection:
string className="MyClass";
var type1=Type.GetType(className, true); //I have a problem loading the class here.
I have a class :
Class MyClass
{
...
}
I need to get the type of the class in order to use it in reflection:
string className="MyClass";
var type1=Type.GetType(className, true); //I have a problem loading the class here.
You can try to use Type Properties
typeof(T).Name
and if you are dealing with instance then
this.GetType().Name
You don't necessarily need the name, you can directly do:
var type1 = typeof(MyClass);