Reacting to Hosting changes

This commit is contained in:
John Luo 2016-03-22 11:47:08 -07:00
parent a1f32e5651
commit c43fb71cff
3 changed files with 4 additions and 2 deletions

View File

@ -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<Startup>()

View File

@ -18,6 +18,7 @@ namespace Microsoft.AspNetCore.Hosting
/// <summary>
/// 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.
/// </summary>
/// <param name="app"></param>
/// <returns></returns>
@ -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 =>
{

View File

@ -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")