Hi ... I tried to do this in that way
object bla;
bla =
Activator.CreateInstance(System.Reflection.Assembl y.GetExecutingAssembly().T
oString(),"DynClass");
public class DynClass
{
public DynClass(){}
}
but it always says: "Could not load type DynClass from assembly test"
Can you tell me whats wrong?
Thanks
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> schrieb
im Newsbeitrag news:%2***************@TK2MSFTNGP11.phx.gbl...
Patrick,
Yes, you can. You can use the static CreateInstance method on the
Activator class to do this.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Patrick" <pa********@bluemail.ch> wrote in message
news:10***************@fuchs.cyberlink.ch... Is there a way, to create dynamicly an object from a variable in c#.
Something like
string myclass ="testclass";
Object t = new (object)myclass;
then the contains a new testclass ...
any idea how to do this??