Reacting to hosting rename
This commit is contained in:
parent
ae3c77b9c5
commit
f08e1f9428
|
|
@ -29,13 +29,13 @@ namespace DatabaseErrorPageSample
|
||||||
|
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
var application = new WebApplicationBuilder()
|
var host = new WebHostBuilder()
|
||||||
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
|
.UseDefaultConfiguration(args)
|
||||||
.UseIISPlatformHandlerUrl()
|
.UseIISPlatformHandlerUrl()
|
||||||
.UseStartup<Startup>()
|
.UseStartup<Startup>()
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
application.Run();
|
host.Run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,13 +21,13 @@ namespace DeveloperExceptionPageSample
|
||||||
|
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
var application = new WebApplicationBuilder()
|
var host = new WebHostBuilder()
|
||||||
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
|
.UseDefaultConfiguration(args)
|
||||||
.UseIISPlatformHandlerUrl()
|
.UseIISPlatformHandlerUrl()
|
||||||
.UseStartup<Startup>()
|
.UseStartup<Startup>()
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
application.Run();
|
host.Run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -31,13 +31,13 @@ namespace ElmPageSample
|
||||||
|
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
var application = new WebApplicationBuilder()
|
var host = new WebHostBuilder()
|
||||||
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
|
.UseDefaultConfiguration(args)
|
||||||
.UseIISPlatformHandlerUrl()
|
.UseIISPlatformHandlerUrl()
|
||||||
.UseStartup<Startup>()
|
.UseStartup<Startup>()
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
application.Run();
|
host.Run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,13 +58,13 @@ namespace ExceptionHandlerSample
|
||||||
|
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
var application = new WebApplicationBuilder()
|
var host = new WebHostBuilder()
|
||||||
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
|
.UseDefaultConfiguration(args)
|
||||||
.UseIISPlatformHandlerUrl()
|
.UseIISPlatformHandlerUrl()
|
||||||
.UseStartup<Startup>()
|
.UseStartup<Startup>()
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
application.Run();
|
host.Run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -85,13 +85,13 @@ namespace MiddlewareAnaysisSample
|
||||||
|
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
var application = new WebApplicationBuilder()
|
var host = new WebHostBuilder()
|
||||||
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
|
.UseDefaultConfiguration(args)
|
||||||
.UseIISPlatformHandlerUrl()
|
.UseIISPlatformHandlerUrl()
|
||||||
.UseStartup<Startup>()
|
.UseStartup<Startup>()
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
application.Run();
|
host.Run();
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TestDiagnosticListener
|
public class TestDiagnosticListener
|
||||||
|
|
|
||||||
|
|
@ -21,13 +21,13 @@ namespace RuntimeInfoPageSample
|
||||||
|
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
var application = new WebApplicationBuilder()
|
var host = new WebHostBuilder()
|
||||||
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
|
.UseDefaultConfiguration(args)
|
||||||
.UseIISPlatformHandlerUrl()
|
.UseIISPlatformHandlerUrl()
|
||||||
.UseStartup<Startup>()
|
.UseStartup<Startup>()
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
application.Run();
|
host.Run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -104,13 +104,13 @@ namespace StatusCodePagesSample
|
||||||
|
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
var application = new WebApplicationBuilder()
|
var host = new WebHostBuilder()
|
||||||
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
|
.UseDefaultConfiguration(args)
|
||||||
.UseIISPlatformHandlerUrl()
|
.UseIISPlatformHandlerUrl()
|
||||||
.UseStartup<Startup>()
|
.UseStartup<Startup>()
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
application.Run();
|
host.Run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -12,13 +12,13 @@ namespace WelcomePageSample
|
||||||
|
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
var application = new WebApplicationBuilder()
|
var host = new WebHostBuilder()
|
||||||
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
|
.UseDefaultConfiguration(args)
|
||||||
.UseIISPlatformHandlerUrl()
|
.UseIISPlatformHandlerUrl()
|
||||||
.UseStartup<Startup>()
|
.UseStartup<Startup>()
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
application.Run();
|
host.Run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task Successful_requests_pass_thru()
|
public async Task Successful_requests_pass_thru()
|
||||||
{
|
{
|
||||||
var builder = new WebApplicationBuilder().Configure(app => app
|
var builder = new WebHostBuilder().Configure(app => app
|
||||||
.UseDatabaseErrorPage()
|
.UseDatabaseErrorPage()
|
||||||
.UseMiddleware<SuccessMiddleware>());
|
.UseMiddleware<SuccessMiddleware>());
|
||||||
var server = new TestServer(builder);
|
var server = new TestServer(builder);
|
||||||
|
|
@ -55,7 +55,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task Non_database_exceptions_pass_thru()
|
public async Task Non_database_exceptions_pass_thru()
|
||||||
{
|
{
|
||||||
var builder = new WebApplicationBuilder().Configure(app => app
|
var builder = new WebHostBuilder().Configure(app => app
|
||||||
.UseDatabaseErrorPage()
|
.UseDatabaseErrorPage()
|
||||||
.UseMiddleware<ExceptionMiddleware>());
|
.UseMiddleware<ExceptionMiddleware>());
|
||||||
var server = new TestServer(builder);
|
var server = new TestServer(builder);
|
||||||
|
|
@ -255,7 +255,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
|
||||||
|
|
||||||
using (var database = SqlServerTestStore.CreateScratch())
|
using (var database = SqlServerTestStore.CreateScratch())
|
||||||
{
|
{
|
||||||
var builder = new WebApplicationBuilder()
|
var builder = new WebHostBuilder()
|
||||||
.Configure(app =>
|
.Configure(app =>
|
||||||
{
|
{
|
||||||
app.UseDatabaseErrorPage(new DatabaseErrorPageOptions
|
app.UseDatabaseErrorPage(new DatabaseErrorPageOptions
|
||||||
|
|
@ -293,7 +293,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
|
||||||
{
|
{
|
||||||
var logProvider = new TestLoggerProvider();
|
var logProvider = new TestLoggerProvider();
|
||||||
|
|
||||||
var builder = new WebApplicationBuilder()
|
var builder = new WebHostBuilder()
|
||||||
.Configure(app =>
|
.Configure(app =>
|
||||||
{
|
{
|
||||||
app.UseDatabaseErrorPage();
|
app.UseDatabaseErrorPage();
|
||||||
|
|
@ -411,7 +411,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
|
||||||
{
|
{
|
||||||
using (var database = SqlServerTestStore.CreateScratch())
|
using (var database = SqlServerTestStore.CreateScratch())
|
||||||
{
|
{
|
||||||
var builder = new WebApplicationBuilder()
|
var builder = new WebHostBuilder()
|
||||||
.Configure(app =>
|
.Configure(app =>
|
||||||
{
|
{
|
||||||
app.UseDatabaseErrorPage();
|
app.UseDatabaseErrorPage();
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task Non_migration_requests_pass_thru()
|
public async Task Non_migration_requests_pass_thru()
|
||||||
{
|
{
|
||||||
var builder = new WebApplicationBuilder().Configure(app => app
|
var builder = new WebHostBuilder().Configure(app => app
|
||||||
.UseMigrationsEndPoint()
|
.UseMigrationsEndPoint()
|
||||||
.UseMiddleware<SuccessMiddleware>());
|
.UseMiddleware<SuccessMiddleware>());
|
||||||
var server = new TestServer(builder);
|
var server = new TestServer(builder);
|
||||||
|
|
@ -73,7 +73,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
|
||||||
|
|
||||||
var path = useCustomPath ? new PathString("/EndPoints/ApplyMyMigrations") : MigrationsEndPointOptions.DefaultPath;
|
var path = useCustomPath ? new PathString("/EndPoints/ApplyMyMigrations") : MigrationsEndPointOptions.DefaultPath;
|
||||||
|
|
||||||
var builder = new WebApplicationBuilder()
|
var builder = new WebHostBuilder()
|
||||||
.Configure(app =>
|
.Configure(app =>
|
||||||
{
|
{
|
||||||
if (useCustomPath)
|
if (useCustomPath)
|
||||||
|
|
@ -125,7 +125,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task Context_type_not_specified()
|
public async Task Context_type_not_specified()
|
||||||
{
|
{
|
||||||
var builder = new WebApplicationBuilder()
|
var builder = new WebHostBuilder()
|
||||||
.Configure(app =>
|
.Configure(app =>
|
||||||
{
|
{
|
||||||
app.UseMigrationsEndPoint();
|
app.UseMigrationsEndPoint();
|
||||||
|
|
@ -145,7 +145,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task Invalid_context_type_specified()
|
public async Task Invalid_context_type_specified()
|
||||||
{
|
{
|
||||||
var builder = new WebApplicationBuilder()
|
var builder = new WebHostBuilder()
|
||||||
.Configure(app =>
|
.Configure(app =>
|
||||||
{
|
{
|
||||||
app.UseMigrationsEndPoint();
|
app.UseMigrationsEndPoint();
|
||||||
|
|
@ -169,7 +169,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task Context_not_registered_in_services()
|
public async Task Context_not_registered_in_services()
|
||||||
{
|
{
|
||||||
var builder = new WebApplicationBuilder()
|
var builder = new WebHostBuilder()
|
||||||
.Configure(app => app.UseMigrationsEndPoint())
|
.Configure(app => app.UseMigrationsEndPoint())
|
||||||
.ConfigureServices(services => services.AddEntityFramework().AddSqlServer());
|
.ConfigureServices(services => services.AddEntityFramework().AddSqlServer());
|
||||||
var server = new TestServer(builder);
|
var server = new TestServer(builder);
|
||||||
|
|
@ -196,7 +196,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
|
||||||
var optionsBuilder = new DbContextOptionsBuilder();
|
var optionsBuilder = new DbContextOptionsBuilder();
|
||||||
optionsBuilder.UseSqlServer(database.ConnectionString);
|
optionsBuilder.UseSqlServer(database.ConnectionString);
|
||||||
|
|
||||||
var builder = new WebApplicationBuilder()
|
var builder = new WebHostBuilder()
|
||||||
.Configure(app => app.UseMigrationsEndPoint())
|
.Configure(app => app.UseMigrationsEndPoint())
|
||||||
.ConfigureServices(services =>
|
.ConfigureServices(services =>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -489,7 +489,7 @@ namespace Microsoft.AspNet.Diagnostics
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
DiagnosticListener diagnosticListener = null;
|
DiagnosticListener diagnosticListener = null;
|
||||||
var builder = new WebApplicationBuilder()
|
var builder = new WebHostBuilder()
|
||||||
.Configure(app =>
|
.Configure(app =>
|
||||||
{
|
{
|
||||||
diagnosticListener = app.ApplicationServices.GetRequiredService<DiagnosticListener>();
|
diagnosticListener = app.ApplicationServices.GetRequiredService<DiagnosticListener>();
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ namespace Microsoft.AspNet.Diagnostics
|
||||||
[InlineData(HttpStatusCode.InternalServerError)]
|
[InlineData(HttpStatusCode.InternalServerError)]
|
||||||
public async Task OnlyHandles_UnhandledExceptions(HttpStatusCode expectedStatusCode)
|
public async Task OnlyHandles_UnhandledExceptions(HttpStatusCode expectedStatusCode)
|
||||||
{
|
{
|
||||||
var builder = new WebApplicationBuilder()
|
var builder = new WebHostBuilder()
|
||||||
.Configure(app =>
|
.Configure(app =>
|
||||||
{
|
{
|
||||||
app.UseExceptionHandler("/handle-errors");
|
app.UseExceptionHandler("/handle-errors");
|
||||||
|
|
@ -59,7 +59,7 @@ namespace Microsoft.AspNet.Diagnostics
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task DoesNotHandle_UnhandledExceptions_WhenResponseAlreadyStarted()
|
public async Task DoesNotHandle_UnhandledExceptions_WhenResponseAlreadyStarted()
|
||||||
{
|
{
|
||||||
var builder = new WebApplicationBuilder()
|
var builder = new WebHostBuilder()
|
||||||
.Configure(app =>
|
.Configure(app =>
|
||||||
{
|
{
|
||||||
app.Use(async (httpContext, next) =>
|
app.Use(async (httpContext, next) =>
|
||||||
|
|
@ -108,7 +108,7 @@ namespace Microsoft.AspNet.Diagnostics
|
||||||
public async Task ClearsResponseBuffer_BeforeRequestIsReexecuted()
|
public async Task ClearsResponseBuffer_BeforeRequestIsReexecuted()
|
||||||
{
|
{
|
||||||
var expectedResponseBody = "New response body";
|
var expectedResponseBody = "New response body";
|
||||||
var builder = new WebApplicationBuilder()
|
var builder = new WebHostBuilder()
|
||||||
.Configure(app =>
|
.Configure(app =>
|
||||||
{
|
{
|
||||||
// add response buffering
|
// add response buffering
|
||||||
|
|
@ -180,7 +180,7 @@ namespace Microsoft.AspNet.Diagnostics
|
||||||
{
|
{
|
||||||
var expiresTime = DateTime.UtcNow.AddDays(5).ToString("R");
|
var expiresTime = DateTime.UtcNow.AddDays(5).ToString("R");
|
||||||
var expectedResponseBody = "Handled error in a custom way.";
|
var expectedResponseBody = "Handled error in a custom way.";
|
||||||
var builder = new WebApplicationBuilder()
|
var builder = new WebHostBuilder()
|
||||||
.Configure(app =>
|
.Configure(app =>
|
||||||
{
|
{
|
||||||
app.UseExceptionHandler("/handle-errors");
|
app.UseExceptionHandler("/handle-errors");
|
||||||
|
|
@ -230,7 +230,7 @@ namespace Microsoft.AspNet.Diagnostics
|
||||||
{
|
{
|
||||||
var expiresTime = DateTime.UtcNow.AddDays(10).ToString("R");
|
var expiresTime = DateTime.UtcNow.AddDays(10).ToString("R");
|
||||||
var expectedResponseBody = "Hello world!";
|
var expectedResponseBody = "Hello world!";
|
||||||
var builder = new WebApplicationBuilder()
|
var builder = new WebHostBuilder()
|
||||||
.Configure(app =>
|
.Configure(app =>
|
||||||
{
|
{
|
||||||
app.UseExceptionHandler("/handle-errors");
|
app.UseExceptionHandler("/handle-errors");
|
||||||
|
|
@ -280,7 +280,7 @@ namespace Microsoft.AspNet.Diagnostics
|
||||||
public async Task DoesNotClearCacheHeaders_WhenResponseHasAlreadyStarted()
|
public async Task DoesNotClearCacheHeaders_WhenResponseHasAlreadyStarted()
|
||||||
{
|
{
|
||||||
var expiresTime = DateTime.UtcNow.AddDays(10).ToString("R");
|
var expiresTime = DateTime.UtcNow.AddDays(10).ToString("R");
|
||||||
var builder = new WebApplicationBuilder()
|
var builder = new WebHostBuilder()
|
||||||
.Configure(app =>
|
.Configure(app =>
|
||||||
{
|
{
|
||||||
app.Use(async (httpContext, next) =>
|
app.Use(async (httpContext, next) =>
|
||||||
|
|
@ -350,7 +350,7 @@ namespace Microsoft.AspNet.Diagnostics
|
||||||
// Arrange
|
// Arrange
|
||||||
DiagnosticListener diagnosticListener = null;
|
DiagnosticListener diagnosticListener = null;
|
||||||
|
|
||||||
var builder = new WebApplicationBuilder()
|
var builder = new WebHostBuilder()
|
||||||
.Configure(app =>
|
.Configure(app =>
|
||||||
{
|
{
|
||||||
diagnosticListener = app.ApplicationServices.GetRequiredService<DiagnosticListener>();
|
diagnosticListener = app.ApplicationServices.GetRequiredService<DiagnosticListener>();
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ namespace Microsoft.AspNet.MiddlewareAnalysis
|
||||||
{
|
{
|
||||||
DiagnosticListener diagnosticListener = null;
|
DiagnosticListener diagnosticListener = null;
|
||||||
|
|
||||||
var builder = new WebApplicationBuilder()
|
var builder = new WebHostBuilder()
|
||||||
.Configure(app =>
|
.Configure(app =>
|
||||||
{
|
{
|
||||||
diagnosticListener = app.ApplicationServices.GetRequiredService<DiagnosticListener>();
|
diagnosticListener = app.ApplicationServices.GetRequiredService<DiagnosticListener>();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue