예제 #1
0
        private static int Main(string[] args)
        {
            Console.CancelKeyPress += (s, e) =>
            {
                e.Cancel = true;
                exitLatch.Set();
            };

            var exitCode = 0;

            try
            {
                var options = new Options();
                options.Parse(args);

                log.Info("Port:{0}", options.Port);
                log.Info("Webroot:{0}", options.WebRoot);
                log.Info("FrameworkWebConfig:{0}", options.FrameworkWebConfig);
                log.Info("RuntimeVersion:{0}", options.RuntimeVersion);
                log.Info("IsAspNetCore:{0}", options.IsAspNetCore);

                var configGenerator = new ConfigGenerator(options.WebRoot);
                var webConfig       = WebConfig.Create(Environment.ExpandEnvironmentVariables(options.FrameworkWebConfig),
                                                       options.WebRoot);
                var settings = configGenerator.Create(
                    options.Port,
                    webConfig,
                    options.RuntimeVersion,
                    Constants.PipelineMode.Integrated,
                    null,
                    null);

                using (var webServer = new WebServer(settings))
                {
                    exitCode = RunWebServer(webServer, log, exitLatch);
                }
            }
            catch (Exception ex)
            {
                log.ErrorException("Error on startup.", ex);
                exitCode = 1;
            }

            return(exitCode);
        }
        private static int Main(string[] args)
        {
            Console.CancelKeyPress += (s, e) =>
            {
                e.Cancel = true;
                exitLatch.Set();
            };

            Console.Error.WriteLine("The use of WebAppServer.exe is deprecated. Please use the hwc-buildpack instead.");

            var exitCode = 0;

            try
            {
                var options = new Options();
                options.Parse(args);

                log.Info("Port:{0}", options.Port);
                log.Info("Webroot:{0}", options.WebRoot);

                var configGenerator = new ConfigGenerator(options.WebRoot);
                var webConfig       = WebConfig.Create(Environment.ExpandEnvironmentVariables(Constants.FrameworkPaths.FourDotZeroWebConfig),
                                                       AppDomain.CurrentDomain.BaseDirectory);
                var settings = configGenerator.Create(
                    options.Port,
                    webConfig,
                    Constants.RuntimeVersion.VersionFourDotZero,
                    Constants.PipelineMode.Integrated,
                    null,
                    null);

                using (var webServer = new WebServer(settings))
                {
                    exitCode = RunWebServer(webServer, log, exitLatch);
                }
            }
            catch (Exception ex)
            {
                log.ErrorException("Error on startup.", ex);
                exitCode = 1;
            }

            return(exitCode);
        }
예제 #3
0
        private static int Main(string[] args)
        {
            Console.CancelKeyPress += (s, e) =>
            {
                e.Cancel = true;
                exitLatch.Set();
            };

            var exitCode = 0;

            try
            {
                var options = new Options();
                options.Parse(args);

                log.Info("Port:{0}", options.Port);
                log.Info("Webroot:{0}", options.WebRoot);

                var configGenerator = new ConfigGenerator(options.WebRoot);
                var settings        = configGenerator.Create(
                    options.Port,
                    Constants.FrameworkPaths.FourDotZeroWebConfig,
                    Constants.RuntimeVersion.VersionFourDotZero,
                    Constants.PipelineMode.Integrated,
                    null,
                    null);

                using (var webServer = new WebServer(settings))
                {
                    exitCode = RunWebServer(webServer, log, exitLatch);
                }
            }
            catch (Exception ex)
            {
                log.ErrorException("Error on startup.", ex);
                exitCode = 1;
            }

            return(exitCode);
        }
예제 #4
0
        private static int Main(string[] args)
        {
            Console.CancelKeyPress += (s, e) =>
            {
                e.Cancel = true;
                exitLatch.Set();
            };

            var exitCode = 0;
            try
            {
                var options = new Options();
                options.Parse(args);

                log.Info("Port:{0}", options.Port);
                log.Info("Webroot:{0}", options.WebRoot);

                var configGenerator = new ConfigGenerator(options.WebRoot);
                var settings = configGenerator.Create(
                    options.Port,
                    Constants.FrameworkPaths.FourDotZeroWebConfig,
                    Constants.RuntimeVersion.VersionFourDotZero,
                    Constants.PipelineMode.Integrated,
                    null,
                    null);

                using (var webServer = new WebServer(settings))
                {
                    exitCode = RunWebServer(webServer, log, exitLatch);
                }
            }
            catch (Exception ex)
            {
                log.ErrorException("Error on startup.", ex);
                exitCode = 1;
            }

            return exitCode;
        }