This is what I do:
byte[] bytes = File.ReadAllBytes(@Application.StartupPath+"/UpdateMainProgaramApp.exe"); Assembly assembly = Assembly.Load(bytes);
The problem is that it throws this TargetInvocationException - it detects that the method is the main one, but it throws this exception, because in this line:
object o = assembly.CreateInstance(method.Name);
o remains equal to zero. So I dug a little into this stack, and the actual error is this:
InnerException = {"SetCompatibleTextRenderingDefault must be called before the first IWin32Window object is created in the program"} (this is my translation, since it gives me a stack of half Hebrew half English, since my windows are in Hebrew.)
What am I doing wrong?
source share