Hi,
Yes. You can.
If you want to manipulate the dynamically created objects, then you need to
have reference to them.
To do that either you can go for Interfaces and Classes.
eg)
using System;
using System.Reflecti on;
namespace sampleNamespace
{
public class Class1
{
public Class1()
{
Assembly sampleAssembly = Assembly.LoadFr om(@"c:\\sample .dll");
ISample sampleObj =
sampleAssembly. CreateInstance( "sampleNameSpac e.SampleClass") ;
sampleObj.sampl eMethod(1);
}
}
}
Regards,
R.Balaji
"Irfan" <go*******@yaho o.com> wrote in message
news:ee******** ******@TK2MSFTN GP12.phx.gbl...
Hi all
I am new to DotNet and C#
Is there any way to get a type of object from a string. Lets suppose i
have a string variable containing a type "MyNameSpace.My Component" where
MyComponent.dll is already been referenced in the client project.
Now i want to create any object from that string. I think this require
getting a type from that string and then creating object from that type.
If this or any alternative is possible, pls let me know with a little
example.
Regards,
Irfan