diff --git a/samples/IISSample/Startup.cs b/samples/IISSample/Startup.cs index 74b699e206..dbc57aab59 100644 --- a/samples/IISSample/Startup.cs +++ b/samples/IISSample/Startup.cs @@ -75,7 +75,7 @@ namespace IISSample public static void Main(string[] args) { var host = new WebHostBuilder() - .UseDefaultConfiguration(args) + .UseDefaultHostingConfiguration(args) .UseServer("Microsoft.AspNetCore.Server.Kestrel") .UseIIS() .UseStartup() diff --git a/src/Microsoft.AspNetCore.Server.IISIntegration/IISWebHostExtensions.cs b/src/Microsoft.AspNetCore.Server.IISIntegration/IISWebHostExtensions.cs index e1b9134832..6e765aed6a 100644 --- a/src/Microsoft.AspNetCore.Server.IISIntegration/IISWebHostExtensions.cs +++ b/src/Microsoft.AspNetCore.Server.IISIntegration/IISWebHostExtensions.cs @@ -18,6 +18,7 @@ namespace Microsoft.AspNetCore.Hosting /// /// Configures the port and base path the server should listen on when running behind AspNetCoreModule. + /// The app will also be configured to capture startup errors. /// /// /// @@ -36,6 +37,7 @@ namespace Microsoft.AspNetCore.Hosting { var address = "http://localhost:" + port + path; app.UseSetting(WebHostDefaults.ServerUrlsKey, address); + app.CaptureStartupErrors(true); app.ConfigureServices(services => { diff --git a/test/TestSites/Program.cs b/test/TestSites/Program.cs index 110f51ae6b..c6f331a3c0 100644 --- a/test/TestSites/Program.cs +++ b/test/TestSites/Program.cs @@ -10,7 +10,7 @@ namespace TestSites public static void Main(string[] args) { var host = new WebHostBuilder() - .UseDefaultConfiguration(args) + .UseDefaultHostingConfiguration(args) .UseIIS() .UseStartup("TestSites") .UseServer("Microsoft.AspNetCore.Server.Kestrel")