I tried to find this exception, but could not find a solution on my case
I am using the code below to call a .NET application:
Assembly assem = Assembly.Load(Data);
MethodInfo method = assem.EntryPoint;
var o = Activator.CreateInstance(method.DeclaringType);
method.Invoke(o, null);
The application that will be called has the form in the EntryPoint application:
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
SetCompatibleTextRenderingDefaultmust be called before the first IWin32Windowobject is created in the application .
EDIT:
Assembly a = Assembly.Load(Data);
MethodInfo method = a.GetType().GetMethod("Start");
var o = Activator.CreateInstance(method.DeclaringType);
method.Invoke(o, null);
source
share