コード例 #1
0
ファイル: Global.asax.cs プロジェクト: joethinh/nohros-must
    protected void Application_Start(object sender, EventArgs e) {
      string config_file_name =
        WebConfigurationManager.AppSettings[Strings.kConfigFileNameKey];
      string config_file_path = Server.MapPath(config_file_name);
      Settings settings = new Settings.Loader()
        .Load(config_file_path, Strings.kConfigRootNodeName);

      var factory = new HttpQueryApplicationFactory(settings);
      factory.ConfigureLogger();

      // log any unhandled exception that may occur for futher investigation.
      AppDomain.CurrentDomain.UnhandledException +=
        (obj, args) =>
          HttpQueryLogger.ForCurrentProcess.Error(
            string.Format(StringResources.Log_ThrowsException, "Application"),
            (System.Exception) args.ExceptionObject);

      HttpQueryApplication app = factory.CreateQueryApplication();
      Application[Strings.kApplicationKey] = app;
      app.Start();
    }
コード例 #2
0
        protected void Application_Start(object sender, EventArgs e)
        {
            string config_file_name =
                WebConfigurationManager.AppSettings[Strings.kConfigFileNameKey];
            string   config_file_path = Server.MapPath(config_file_name);
            Settings settings         = new Settings.Loader()
                                        .Load(config_file_path, Strings.kConfigRootNodeName);

            var factory = new HttpQueryApplicationFactory(settings);

            factory.ConfigureLogger();

            // log any unhandled exception that may occur for futher investigation.
            AppDomain.CurrentDomain.UnhandledException +=
                (obj, args) =>
                HttpQueryLogger.ForCurrentProcess.Error(
                    string.Format(StringResources.Log_ThrowsException, "Application"),
                    (System.Exception)args.ExceptionObject);

            HttpQueryApplication app = factory.CreateQueryApplication();

            Application[Strings.kApplicationKey] = app;
            app.Start();
        }