Reacting to hosting rename

This commit is contained in:
John Luo 2016-01-17 16:13:21 -08:00
parent 129a5ad474
commit 9885377148
8 changed files with 33 additions and 43 deletions

View File

@ -38,12 +38,12 @@ namespace LargeResponseApp
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
var host = new WebHostBuilder()
.UseDefaultConfiguration(args)
.UseStartup<Startup>()
.Build();
application.Run();
host.Run();
}
}
}

View File

@ -7,7 +7,6 @@ using System.Security.Cryptography.X509Certificates;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.Http;
using Microsoft.AspNet.Http.Features;
using Microsoft.AspNet.Server.Kestrel;
using Microsoft.AspNet.Server.Kestrel.Filter;
using Microsoft.Extensions.Logging;
@ -65,8 +64,8 @@ namespace SampleApp
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
var host = new WebHostBuilder()
.UseDefaultConfiguration(args)
.UseStartup<Startup>()
.Build();
@ -75,7 +74,7 @@ namespace SampleApp
//addresses.Clear();
//addresses.Add("http://unix:/tmp/kestrel-test.sock");
application.Run();
host.Run();
}
}
}

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" forwardWindowsAuthToken="false" startupTimeLimit="3600" />
</system.webServer>
</configuration>

View File

@ -40,14 +40,14 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests
})
.Build();
var applicationBuilder = new WebApplicationBuilder()
var hostBuilder = new WebHostBuilder()
.UseConfiguration(config)
.UseServer("Microsoft.AspNet.Server.Kestrel")
.Configure(ConfigureEchoAddress);
using (var app = applicationBuilder.Build())
using (var host = hostBuilder.Build())
{
app.Start();
host.Start();
using (var client = new HttpClient())
{

View File

@ -79,7 +79,7 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests
{ "server.urls", registerAddress }
}).Build();
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.UseConfiguration(config)
.UseServer("Microsoft.AspNet.Server.Kestrel")
.Configure(app =>
@ -94,9 +94,9 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests
});
});
using (var app = builder.Build())
using (var host = builder.Build())
{
app.Start();
host.Start();
using (var client = new HttpClient())
{

View File

@ -29,7 +29,7 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests
})
.Build();
var applicationBuilder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.UseConfiguration(config)
.UseServer("Microsoft.AspNet.Server.Kestrel")
.Configure(app =>
@ -54,9 +54,9 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests
});
});
using (var app = applicationBuilder.Build())
using (var host = builder.Build())
{
app.Start();
host.Start();
using (var client = new HttpClient())
{
@ -100,7 +100,7 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests
{ "server.urls", "http://localhost:8791" }
}).Build();
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.UseConfiguration(config)
.UseServer("Microsoft.AspNet.Server.Kestrel")
.Configure(app =>
@ -112,10 +112,10 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests
});
});
using (var app = builder.Build())
using (var host = builder.Build())
using (var client = new HttpClient())
{
app.Start();
host.Start();
client.DefaultRequestHeaders.Connection.Clear();
client.DefaultRequestHeaders.Connection.Add("close");
@ -132,7 +132,7 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests
{ "server.urls", $"http://{registerAddress}:{port}" }
}).Build();
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.UseConfiguration(config)
.UseServer("Microsoft.AspNet.Server.Kestrel")
.Configure(app =>
@ -151,10 +151,10 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests
});
});
using (var app = builder.Build())
using (var host = builder.Build())
using (var client = new HttpClient())
{
app.Start();
host.Start();
var response = await client.GetAsync($"http://{requestAddress}:{port}/");
response.EnsureSuccessStatusCode();

View File

@ -30,7 +30,7 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests
})
.Build();
var applicationBuilder = new WebApplicationBuilder()
var hostBuilder = new WebHostBuilder()
.UseConfiguration(config)
.UseServer("Microsoft.AspNet.Server.Kestrel")
.Configure(app =>
@ -52,9 +52,9 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests
});
});
using (var app = applicationBuilder.Build())
using (var host = hostBuilder.Build())
{
app.Start();
host.Start();
using (var client = new HttpClient())
{
@ -90,7 +90,7 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests
})
.Build();
var hostBuilder = new WebApplicationBuilder()
var hostBuilder = new WebHostBuilder()
.UseConfiguration(config)
.UseServer("Microsoft.AspNet.Server.Kestrel")
.Configure(app =>
@ -103,9 +103,9 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests
});
});
using (var app = hostBuilder.Build())
using (var host = hostBuilder.Build())
{
app.Start();
host.Start();
using (var client = new HttpClient())
{
@ -141,7 +141,7 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests
var onStartingCalled = false;
var onCompletedCalled = false;
var hostBuilder = new WebApplicationBuilder()
var hostBuilder = new WebHostBuilder()
.UseConfiguration(config)
.UseServer("Microsoft.AspNet.Server.Kestrel")
.Configure(app =>
@ -156,9 +156,9 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests
});
});
using (var app = hostBuilder.Build())
using (var host = hostBuilder.Build())
{
app.Start();
host.Start();
using (var client = new HttpClient())
{

View File

@ -23,7 +23,7 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests
})
.Build();
var applicationBuilder = new WebApplicationBuilder()
var hostBuilder = new WebHostBuilder()
.UseConfiguration(config)
.UseServer("Microsoft.AspNet.Server.Kestrel")
.Configure(app =>
@ -36,9 +36,9 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests
});
});
using (var app = applicationBuilder.Build())
using (var host = hostBuilder.Build())
{
app.Start();
host.Start();
using (var client = new HttpClient())
{