static void Main() { Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("en-US"); AppDomain.CurrentDomain.AssemblyResolve += Resolver; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var hiddenForm = new XtraForm(); hiddenForm.Load += delegate { hiddenForm.Size = new Size(0, 0); hiddenForm.ShowInTaskbar = false; hiddenForm.FormBorderStyle = FormBorderStyle.None; XWebViewThreadSync.Inst.InvokeAsync(() => { ApplicationStartup(); }); }; //In example we use invisible main form as synchronization context. //It's important for ThreadSync that main form must be available during all app lifetime. XWebViewThreadSync.Init(new WinFormsThreadSyncInvoker(hiddenForm)); InitializeCefSharp(); Application.Run(hiddenForm); }
static void Main(string[] args) { AppDomain.CurrentDomain.AssemblyResolve += Resolver; InitializeCefSharp(); XWebViewThreadSync.Init(new CefSharpThreadSyncInvoker()); var cmds = new CmdSwitcher(); cmds.PushCmdInStack(new TestCmdLine()); cmds.ExecuteStartup(args); cmds.RunDefault(); }