static void Main(string[] args) { SetConsoleCtrlHandler(_handle, true); //AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; //YarSystem.Init("YarApp.config"); YarSystem.Init(YarSystem.AppModelEnum.Local, Path.GetDirectoryName(typeof(YarSystem).Assembly.CodeBase).Replace(@"file:\", ""), null); YarSystem.WriteLog("--------------------------------------------"); YarSystem.Current.Start(); CommandLine(); YarSystem.Current.Stop(); }
protected void Application_Start() { YarSystem.Init(YarSystem.AppModelEnum.Web, Server.MapPath("~/"), null); var site = System.Web.Hosting.HostingEnvironment.ApplicationHost.GetVirtualPath(); YarSystem.Current.ViewSite = site.TrimEnd('/'); YarSystem.WriteLog("--------------------------------------------"); YarSystem.Current.Start(); Yar.Service.HttpApi.HttpApiServerUtils.RegisterWebApiForAspNet(GlobalConfiguration.Configuration); AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); if (YarSystem.Current.AppSettings["runtype"] == "release") { BundleTable.EnableOptimizations = true; } BundleConfig.RegisterBundles(BundleTable.Bundles); }