From b163497c7ecdebc3976fbe93f03e60549f9c5aa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Chalet?= Date: Fri, 29 Apr 2016 06:48:42 +0200 Subject: [PATCH] React to API changes in aspnet/Hosting https://github.com/aspnet/Hosting/commit/e505ecbc2176cc35b6fb0e3fd51fc7bf4c484cf4 --- samples/Mvc.Client/Program.cs | 8 +++++++- samples/Mvc.Client/project.json | 2 ++ samples/Mvc.Server/Program.cs | 8 +++++++- samples/Mvc.Server/project.json | 2 ++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/samples/Mvc.Client/Program.cs b/samples/Mvc.Client/Program.cs index 437738f4..84b28c53 100644 --- a/samples/Mvc.Client/Program.cs +++ b/samples/Mvc.Client/Program.cs @@ -1,13 +1,19 @@ using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; namespace Mvc.Client { public static class Program { public static void Main(string[] args) { + var configuration = new ConfigurationBuilder() + .AddEnvironmentVariables() + .AddCommandLine(args) + .Build(); + var host = new WebHostBuilder() .ConfigureLogging(options => options.AddConsole()) .ConfigureLogging(options => options.AddDebug()) - .UseDefaultHostingConfiguration(args) + .UseConfiguration(configuration) .UseIISIntegration() .UseKestrel() .UseStartup() diff --git a/samples/Mvc.Client/project.json b/samples/Mvc.Client/project.json index de829eed..3772aaa4 100644 --- a/samples/Mvc.Client/project.json +++ b/samples/Mvc.Client/project.json @@ -15,6 +15,8 @@ "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-*", "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-*", "Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-*", + "Microsoft.Extensions.Configuration.CommandLine": "1.0.0-rc2-*", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-*", "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-*", "Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-*" }, diff --git a/samples/Mvc.Server/Program.cs b/samples/Mvc.Server/Program.cs index a3bdc32c..7966c65e 100644 --- a/samples/Mvc.Server/Program.cs +++ b/samples/Mvc.Server/Program.cs @@ -1,13 +1,19 @@ using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; namespace Mvc.Server { public static class Program { public static void Main(string[] args) { + var configuration = new ConfigurationBuilder() + .AddEnvironmentVariables() + .AddCommandLine(args) + .Build(); + var host = new WebHostBuilder() .ConfigureLogging(options => options.AddConsole()) .ConfigureLogging(options => options.AddDebug()) - .UseDefaultHostingConfiguration(args) + .UseConfiguration(configuration) .UseIISIntegration() .UseKestrel() .UseStartup() diff --git a/samples/Mvc.Server/project.json b/samples/Mvc.Server/project.json index bc710a8a..19abfd45 100644 --- a/samples/Mvc.Server/project.json +++ b/samples/Mvc.Server/project.json @@ -18,6 +18,8 @@ "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-*", "Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-*", "Microsoft.EntityFrameworkCore.SqlServer": "1.0.0-rc2-*", + "Microsoft.Extensions.Configuration.CommandLine": "1.0.0-rc2-*", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-*", "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-*", "Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-*", "OpenIddict": "1.0.0-*"