Load WPF application from the memory
问题 So this is how you invoke Main() in non WPF applications: var entry = assembly.EntryPoint; if (assembly.EntryPoint.GetParameters().Length == 0) entry.Invoke(null, new object[0]); else entry.Invoke(null, new object[] { args }); but somehow it doesn't work at all for WPF applications, I've tried (MSDN's way): Assembly asm = Assembly.LoadFrom(file); Type myType = asm.GetType("WpfApplication1.App"); // Get the method to call. MethodInfo myMethod = myType.GetMethod("Main"); // Create an instance.