static void Main() { System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false; Assembly ass = Assembly.Load("Toyz4net.App"); String cfgName = "Toyz4net.App.SQLite.cfg.xml"; NHibernateHelper.CreateCfg(ass, cfgName, Gobal.LOCAL_DB_CS); NHibernateHelper.CreateSessionFactory(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm()); }