B
bahadirarslan
Hi All,
I have a problem with Activator.CreateInstance method.
I have got a class like this
public class YaziYaz
{
public YaziYaz()
{
HttpContext.Current.Response.Write("Running");
}
public YaziYaz(object[] Params)
{
if (Params.Length == 0)
HttpContext.Current.Response.Write("No data");
else
{
foreach(object o in Params)
{
HttpContext.Current.Response.Write(o.ToString() +" <br /> ");
}
}
}
}
}
and i want to load this class dynamically with these codes
Assembly ass = Assembly.GetExecutingAssembly();
Type typ = ass.GetType("MyNameSpace.YaziYaz",false);
object ornek = Activator.CreateInstance(typ, Params); // error line
But i got an error:
Constructor on type MyNameSpace.YaziYaz not found.
Any suggestions?
I have a problem with Activator.CreateInstance method.
I have got a class like this
public class YaziYaz
{
public YaziYaz()
{
HttpContext.Current.Response.Write("Running");
}
public YaziYaz(object[] Params)
{
if (Params.Length == 0)
HttpContext.Current.Response.Write("No data");
else
{
foreach(object o in Params)
{
HttpContext.Current.Response.Write(o.ToString() +" <br /> ");
}
}
}
}
}
and i want to load this class dynamically with these codes
Assembly ass = Assembly.GetExecutingAssembly();
Type typ = ass.GetType("MyNameSpace.YaziYaz",false);
object ornek = Activator.CreateInstance(typ, Params); // error line
But i got an error:
Constructor on type MyNameSpace.YaziYaz not found.
Any suggestions?