On May 6, 2:17 pm, Jon <JonMYa...@gmail.comwrote:
Hello all,
I'm trying to do the above, pass in an object name and it return the
type, but it's erroring, I've seen something like this before but
can't quite remember. Can this be done?
Thanks
Jon
hi , what is your environment ? are you doing it in asp.net and your
cusotm objects if yes, the problem is that this object lives in
another assembly whose name you do not know, if this is the this is a
workaround, it works only if all classes are in same directory
(app_code) which will be compiled to same dll
//
Type rootType = typeof (SomeClassFromAppCode);
string fullAssemblyName = rootType.Assembly.FullName;
string fullClassName = typeName +", " + fullAssemblyName;
Type type = Type.GetType(fullClassName);