예제 #1
0
        public static void Main(string[] args)
        {
            var config = new ConfigurationBuilder()
                         .AddCommandLine(args)
                         .Build();

            var host = new WebHostBuilder()
                       .UseIISIntegration()
                       .UseKestrel()
                       .UseConfiguration(config)
                       .UseStartup <Startup>()
                       .Build();

            using (host)
            {
                using (var cts = new CancellationTokenSource())
                {
                    host.Run((services) =>
                    {
                        var orchardHost = new OrchardHost(
                            services,
                            System.Console.In,
                            System.Console.Out,
                            args);

                        orchardHost
                        .RunAsync()
                        .Wait();

                        cts.Cancel();
                    }, cts.Token, "Application started. Press Ctrl+C to shut down.");
                }
            }
        }
예제 #2
0
        public static void Main(string[] args)
        {
            var currentDirectory = Directory.GetCurrentDirectory();

            var host = new WebHostBuilder()
                       .UseIISIntegration()
                       .UseKestrel()
                       .UseContentRoot(currentDirectory)
                       .UseStartup <Startup>()
                       .Build();

            using (host)
            {
                using (var cts = new CancellationTokenSource())
                {
                    host.Run((services) =>
                    {
                        var orchardHost = new OrchardHost(
                            services,
                            System.Console.In,
                            System.Console.Out,
                            args);

                        orchardHost
                        .RunAsync()
                        .Wait();

                        cts.Cancel();
                    }, cts.Token, "Application started. Press Ctrl+C to shut down.");
                }
            }
        }
예제 #3
0
        public static void Main(string[] args)
        {
            var host = new WebHostBuilder()
                       .UseKestrel()
                       .UseDefaultHostingConfiguration(args)
                       .UseStartup <Startup>()
                       .Build();

            using (host)
            {
                host.Run();

                var orchardHost = new OrchardHost(host.Services, System.Console.In, System.Console.Out, args);
                orchardHost.Run();
            }
        }
예제 #4
0
        //https://github.com/aspnet/Hosting/blob/dev/src/Microsoft.AspNet.Hosting/Program.cs
        public Task <int> Main(string[] args)
        {
            //Add command line configuration source to read command line parameters.
            var builder = new ConfigurationBuilder().AddCommandLine(args);
            var config  = builder.Build();

            var host = new WebHostBuilder(_serviceProvider, config, true)
                       .UseServer("Microsoft.AspNet.Server.Kestrel")
                       .Build();

            using (var app = host.Start()) {
                var orchardHost = new OrchardHost(app.Services, System.Console.In, System.Console.Out, args);

                return(Task.FromResult(
                           (int)orchardHost.Run()));
            }
        }
예제 #5
0
        public static void Main(string[] args)
        {
            var host = new WebHostBuilder()
                       .UseIISIntegration()
                       .UseKestrel()
                       .UseDefaultHostingConfiguration(args)
                       .UseContentRoot(Directory.GetCurrentDirectory())
                       .UseWebRoot(Directory.GetCurrentDirectory())
                       .UseStartup <Startup>()
                       .Build();

            using (host)
            {
                host.Run();

                var orchardHost = new OrchardHost(host.Services, System.Console.In, System.Console.Out, args);
                orchardHost.Run();
            }
        }