Ejemplo n.º 1
0
        protected void Application_Start(object sender, EventArgs e)
        {
            //Initialize your application
            var appHost = new HelloAppHost();

            appHost.Init();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Simple Application Start Event Handler which just initializes the application
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Application_Start(object sender, EventArgs e)
        {
            String logConf = Path.Combine(Server.MapPath("/"), "log4net.xml");
            log4net.Config.XmlConfigurator.ConfigureAndWatch(new FileInfo(logConf));
            String logFile = Path.Combine(Server.MapPath("/"), "people.log");

            log4net.Appender.FileAppender fa = new log4net.Appender.FileAppender();
            fa.Name = "FileAppender";
            fa.File = logFile;
            fa.Layout = new log4net.Layout.PatternLayout(pattern);
            fa.Threshold = log4net.Core.Level.Debug;
            fa.AppendToFile = true;
            fa.ActivateOptions();

            log4net.Repository.Hierarchy.Hierarchy hierarchy = (log4net.Repository.Hierarchy.Hierarchy)log4net.LogManager.GetRepository();
            hierarchy.Root.AddAppender(fa);
            m_log.Info("Copyright Gary MacDonald 2012.");

            ServicePointManager.ServerCertificateValidationCallback +=
                delegate(object requestSender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
                {
                    m_log.Info("Certificate Validation Callback!");
                    // **** Always accept for now XXX
                    return true;
                };
            var appHost = new HelloAppHost();
            appHost.Init();
        }