From e344edc2a30f86d139d720b772bb63a472fa0bd7 Mon Sep 17 00:00:00 2001 From: John Luo Date: Tue, 26 Apr 2016 18:16:12 -0700 Subject: [PATCH] React to default hosting configuration changes --- samples/IISSample/Startup.cs | 1 - .../WebHostBuilderIISExtensions.cs | 6 +++--- test/TestSites.Portable/Program.cs | 1 - test/TestSites/Program.cs | 1 - 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/samples/IISSample/Startup.cs b/samples/IISSample/Startup.cs index d2873e99b3..995c70e436 100644 --- a/samples/IISSample/Startup.cs +++ b/samples/IISSample/Startup.cs @@ -75,7 +75,6 @@ namespace IISSample public static void Main(string[] args) { var host = new WebHostBuilder() - .UseDefaultHostingConfiguration(args) .UseKestrel() .UseIISIntegration() .UseStartup() diff --git a/src/Microsoft.AspNetCore.Server.IISIntegration/WebHostBuilderIISExtensions.cs b/src/Microsoft.AspNetCore.Server.IISIntegration/WebHostBuilderIISExtensions.cs index 1b49fdbceb..febfe61017 100644 --- a/src/Microsoft.AspNetCore.Server.IISIntegration/WebHostBuilderIISExtensions.cs +++ b/src/Microsoft.AspNetCore.Server.IISIntegration/WebHostBuilderIISExtensions.cs @@ -29,9 +29,9 @@ namespace Microsoft.AspNetCore.Hosting throw new ArgumentNullException(nameof(app)); } - var port = app.GetSetting(ServerPort); - var path = app.GetSetting(ServerPath); - var pairingToken = app.GetSetting(PairingToken); + var port = app.GetSetting(ServerPort) ?? Environment.GetEnvironmentVariable($"ASPNETCORE_{ServerPort}"); + var path = app.GetSetting(ServerPath) ?? Environment.GetEnvironmentVariable($"ASPNETCORE_{ServerPath}"); + var pairingToken = app.GetSetting(PairingToken) ?? Environment.GetEnvironmentVariable($"ASPNETCORE_{PairingToken}"); if (!string.IsNullOrEmpty(port) && !string.IsNullOrEmpty(path) && !string.IsNullOrEmpty(pairingToken)) { diff --git a/test/TestSites.Portable/Program.cs b/test/TestSites.Portable/Program.cs index a37a069b9e..181b270b0d 100644 --- a/test/TestSites.Portable/Program.cs +++ b/test/TestSites.Portable/Program.cs @@ -10,7 +10,6 @@ namespace TestSites.Portable public static void Main(string[] args) { var host = new WebHostBuilder() - .UseDefaultHostingConfiguration(args) .UseIISIntegration() .UseStartup("TestSites.Portable") .UseKestrel() diff --git a/test/TestSites/Program.cs b/test/TestSites/Program.cs index 71b7571838..873d8d562b 100644 --- a/test/TestSites/Program.cs +++ b/test/TestSites/Program.cs @@ -10,7 +10,6 @@ namespace TestSites public static void Main(string[] args) { var host = new WebHostBuilder() - .UseDefaultHostingConfiguration(args) .UseIISIntegration() .UseStartup("TestSites") .UseKestrel()