Reacting to Hosting changes
This commit is contained in:
parent
a1f32e5651
commit
c43fb71cff
|
|
@ -75,7 +75,7 @@ namespace IISSample
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
var host = new WebHostBuilder()
|
var host = new WebHostBuilder()
|
||||||
.UseDefaultConfiguration(args)
|
.UseDefaultHostingConfiguration(args)
|
||||||
.UseServer("Microsoft.AspNetCore.Server.Kestrel")
|
.UseServer("Microsoft.AspNetCore.Server.Kestrel")
|
||||||
.UseIIS()
|
.UseIIS()
|
||||||
.UseStartup<Startup>()
|
.UseStartup<Startup>()
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ namespace Microsoft.AspNetCore.Hosting
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Configures the port and base path the server should listen on when running behind AspNetCoreModule.
|
/// 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>
|
/// </summary>
|
||||||
/// <param name="app"></param>
|
/// <param name="app"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
|
@ -36,6 +37,7 @@ namespace Microsoft.AspNetCore.Hosting
|
||||||
{
|
{
|
||||||
var address = "http://localhost:" + port + path;
|
var address = "http://localhost:" + port + path;
|
||||||
app.UseSetting(WebHostDefaults.ServerUrlsKey, address);
|
app.UseSetting(WebHostDefaults.ServerUrlsKey, address);
|
||||||
|
app.CaptureStartupErrors(true);
|
||||||
|
|
||||||
app.ConfigureServices(services =>
|
app.ConfigureServices(services =>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ namespace TestSites
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
var host = new WebHostBuilder()
|
var host = new WebHostBuilder()
|
||||||
.UseDefaultConfiguration(args)
|
.UseDefaultHostingConfiguration(args)
|
||||||
.UseIIS()
|
.UseIIS()
|
||||||
.UseStartup("TestSites")
|
.UseStartup("TestSites")
|
||||||
.UseServer("Microsoft.AspNetCore.Server.Kestrel")
|
.UseServer("Microsoft.AspNetCore.Server.Kestrel")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue