I have this code:
string x = "DimensionUpdater.Tasks."+className;
string y = "DimensionUpdater.Tasks.DownloadDimensionUpdateTask";
var type = Type.GetType(x);
var type2 = Type.GetType(y);
var task = Activator.CreateInstance(type);
As below the on the image visible, the x
and y
variables are totally the same, but Type.GetType()
return with null for x
Why Type.GetType()
return null
for a string value which was concatenated? And what is the workaround for this?
Aucun commentaire:
Enregistrer un commentaire