Exemplo n.º 1
0
        /// <summary>
        /// Initializes only on the first request
        /// </summary>
        /// <param name="context">The context.</param>
        public static void Init(HttpContext context)
        {
            if (_sInitializedAlready)
            {
                return;
            }

            lock (Locker)
            {
                if (_sInitializedAlready)
                {
                    return;
                }

                //First check if we are upgrading/installing
                if (HttpContext.Current.Request.Url.LocalPath.ToLower().EndsWith("install.aspx"))
                {
                    return;
                }


                switch (UpgradeManager.GetUpgradeStatus())
                {
                case BugNET.Common.UpgradeStatus.Install:
                case BugNET.Common.UpgradeStatus.Upgrade:
                    HttpContext.Current.Response.Redirect("~/Install/Install.aspx", true);
                    return;
                }


                //load the host settings into the application cache
                HostSettingManager.GetHostSettings();

                LoggingManager.ConfigureLogging();

                AuthConfig.RegisterOpenAuth();

                Log.Info("Application Start");

                // Perform first-request initialization here ...
                _sInitializedAlready = true;
            }
        }