diff --git a/.gitignore b/.gitignore index a2eb01c895..0f91ad1208 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ nuget.exe project.lock.json .build/ .testPublish/ +/.vs/ diff --git a/samples/CookieSample/Startup.cs b/samples/CookieSample/Startup.cs index 64376e26e9..a1a5d5bbc1 100644 --- a/samples/CookieSample/Startup.cs +++ b/samples/CookieSample/Startup.cs @@ -44,13 +44,13 @@ namespace CookieSample public static void Main(string[] args) { - var application = new WebApplicationBuilder() - .UseConfiguration(WebApplicationConfiguration.GetDefault(args)) + var host = new WebHostBuilder() + .UseDefaultConfiguration(args) .UseIISPlatformHandlerUrl() .UseStartup() .Build(); - application.Run(); + host.Run(); } } } \ No newline at end of file diff --git a/samples/CookieSessionSample/Startup.cs b/samples/CookieSessionSample/Startup.cs index d9504d942a..6c6c6f3606 100644 --- a/samples/CookieSessionSample/Startup.cs +++ b/samples/CookieSessionSample/Startup.cs @@ -54,13 +54,13 @@ namespace CookieSessionSample public static void Main(string[] args) { - var application = new WebApplicationBuilder() - .UseConfiguration(WebApplicationConfiguration.GetDefault(args)) + var host = new WebHostBuilder() + .UseDefaultConfiguration(args) .UseIISPlatformHandlerUrl() .UseStartup() .Build(); - application.Run(); + host.Run(); } } } \ No newline at end of file diff --git a/samples/JwtBearerSample/Startup.cs b/samples/JwtBearerSample/Startup.cs index abfd83735f..4ef2f6610e 100644 --- a/samples/JwtBearerSample/Startup.cs +++ b/samples/JwtBearerSample/Startup.cs @@ -114,13 +114,13 @@ namespace JwtBearerSample // Entry point for the application. public static void Main(string[] args) { - var application = new WebApplicationBuilder() - .UseConfiguration(WebApplicationConfiguration.GetDefault(args)) + var host = new WebHostBuilder() + .UseDefaultConfiguration(args) .UseIISPlatformHandlerUrl() .UseStartup() .Build(); - application.Run(); + host.Run(); } } } diff --git a/samples/OpenIdConnectSample/Startup.cs b/samples/OpenIdConnectSample/Startup.cs index 50452d1730..1d40a0a92f 100644 --- a/samples/OpenIdConnectSample/Startup.cs +++ b/samples/OpenIdConnectSample/Startup.cs @@ -67,13 +67,13 @@ namespace OpenIdConnectSample public static void Main(string[] args) { - var application = new WebApplicationBuilder() - .UseConfiguration(WebApplicationConfiguration.GetDefault(args)) + var host = new WebHostBuilder() + .UseDefaultConfiguration(args) .UseIISPlatformHandlerUrl() .UseStartup() .Build(); - application.Run(); + host.Run(); } } } diff --git a/samples/SocialSample/Startup.cs b/samples/SocialSample/Startup.cs index e466c019d4..2641725df9 100644 --- a/samples/SocialSample/Startup.cs +++ b/samples/SocialSample/Startup.cs @@ -325,13 +325,13 @@ namespace CookieSample public static void Main(string[] args) { - var application = new WebApplicationBuilder() - .UseConfiguration(WebApplicationConfiguration.GetDefault(args)) + var host = new WebHostBuilder() + .UseDefaultConfiguration(args) .UseIISPlatformHandlerUrl() .UseStartup() .Build(); - application.Run(); + host.Run(); } } } diff --git a/test/Microsoft.AspNet.Authentication.Test/Cookies/CookieMiddlewareTests.cs b/test/Microsoft.AspNet.Authentication.Test/Cookies/CookieMiddlewareTests.cs index 7827566a9f..e6fc0d709b 100644 --- a/test/Microsoft.AspNet.Authentication.Test/Cookies/CookieMiddlewareTests.cs +++ b/test/Microsoft.AspNet.Authentication.Test/Cookies/CookieMiddlewareTests.cs @@ -854,7 +854,7 @@ namespace Microsoft.AspNet.Authentication.Cookies [Fact] public async Task MapWillNotAffectChallenge() { - var builder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .Configure(app => { app.UseCookieAuthentication(new CookieAuthenticationOptions @@ -878,7 +878,7 @@ namespace Microsoft.AspNet.Authentication.Cookies [Fact] public async Task ChallengeDoesNotSet401OnUnauthorized() { - var builder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .Configure(app => { app.UseCookieAuthentication(); @@ -897,7 +897,7 @@ namespace Microsoft.AspNet.Authentication.Cookies [Fact] public async Task UseCookieWithInstanceDoesntUseSharedOptions() { - var builder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .Configure(app => { app.UseCookieAuthentication(new CookieAuthenticationOptions @@ -919,7 +919,7 @@ namespace Microsoft.AspNet.Authentication.Cookies [Fact] public async Task MapWithSignInOnlyRedirectToReturnUrlOnLoginPath() { - var builder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .Configure(app => { app.UseCookieAuthentication(new CookieAuthenticationOptions @@ -940,7 +940,7 @@ namespace Microsoft.AspNet.Authentication.Cookies [Fact] public async Task MapWillNotAffectSignInRedirectToReturnUrl() { - var builder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .Configure(app => { app.UseCookieAuthentication(new CookieAuthenticationOptions @@ -965,7 +965,7 @@ namespace Microsoft.AspNet.Authentication.Cookies [Fact] public async Task MapWithSignOutOnlyRedirectToReturnUrlOnLogoutPath() { - var builder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .Configure(app => { app.UseCookieAuthentication(new CookieAuthenticationOptions @@ -985,7 +985,7 @@ namespace Microsoft.AspNet.Authentication.Cookies [Fact] public async Task MapWillNotAffectSignOutRedirectToReturnUrl() { - var builder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .Configure(app => { app.UseCookieAuthentication(new CookieAuthenticationOptions @@ -1009,7 +1009,7 @@ namespace Microsoft.AspNet.Authentication.Cookies [Fact] public async Task MapWillNotAffectAccessDenied() { - var builder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .Configure(app => { app.UseCookieAuthentication(new CookieAuthenticationOptions @@ -1031,7 +1031,7 @@ namespace Microsoft.AspNet.Authentication.Cookies [Fact] public async Task NestedMapWillNotAffectLogin() { - var builder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .Configure(app => app.Map("/base", map => { @@ -1055,7 +1055,7 @@ namespace Microsoft.AspNet.Authentication.Cookies [Fact] public async Task NestedMapWillNotAffectAccessDenied() { - var builder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .Configure(app => app.Map("/base", map => { @@ -1080,7 +1080,7 @@ namespace Microsoft.AspNet.Authentication.Cookies { var dp = new NoOpDataProtector(); - var builder1 = new WebApplicationBuilder() + var builder1 = new WebHostBuilder() .Configure(app => { app.UseCookieAuthentication(new CookieAuthenticationOptions @@ -1099,7 +1099,7 @@ namespace Microsoft.AspNet.Authentication.Cookies var transaction = await SendAsync(server1, "http://example.com/stuff"); Assert.NotNull(transaction.SetCookie); - var builder2 = new WebApplicationBuilder() + var builder2 = new WebHostBuilder() .Configure(app => { app.UseCookieAuthentication(new CookieAuthenticationOptions @@ -1162,7 +1162,7 @@ namespace Microsoft.AspNet.Authentication.Cookies private static TestServer CreateServer(CookieAuthenticationOptions options, Func testpath = null, Uri baseAddress = null, ClaimsTransformationOptions claimsTransform = null) { - var builder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .Configure(app => { app.UseCookieAuthentication(options); diff --git a/test/Microsoft.AspNet.Authentication.Test/Facebook/FacebookMiddlewareTests.cs b/test/Microsoft.AspNet.Authentication.Test/Facebook/FacebookMiddlewareTests.cs index 95dcb2e5b7..764b63a15a 100644 --- a/test/Microsoft.AspNet.Authentication.Test/Facebook/FacebookMiddlewareTests.cs +++ b/test/Microsoft.AspNet.Authentication.Test/Facebook/FacebookMiddlewareTests.cs @@ -229,7 +229,7 @@ namespace Microsoft.AspNet.Authentication.Facebook private static TestServer CreateServer(Action configure, Action configureServices, Func handler) { - var builder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .Configure(app => { if (configure != null) diff --git a/test/Microsoft.AspNet.Authentication.Test/Google/GoogleMiddlewareTests.cs b/test/Microsoft.AspNet.Authentication.Test/Google/GoogleMiddlewareTests.cs index 6a6f028282..29cc78403c 100644 --- a/test/Microsoft.AspNet.Authentication.Test/Google/GoogleMiddlewareTests.cs +++ b/test/Microsoft.AspNet.Authentication.Test/Google/GoogleMiddlewareTests.cs @@ -757,7 +757,7 @@ namespace Microsoft.AspNet.Authentication.Google private static TestServer CreateServer(GoogleOptions options, Func testpath = null) { - var builder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .Configure(app => { app.UseCookieAuthentication(new CookieAuthenticationOptions diff --git a/test/Microsoft.AspNet.Authentication.Test/JwtBearer/JwtBearerMiddlewareTests.cs b/test/Microsoft.AspNet.Authentication.Test/JwtBearer/JwtBearerMiddlewareTests.cs index 2732d0caaa..6ff7751a93 100644 --- a/test/Microsoft.AspNet.Authentication.Test/JwtBearer/JwtBearerMiddlewareTests.cs +++ b/test/Microsoft.AspNet.Authentication.Test/JwtBearer/JwtBearerMiddlewareTests.cs @@ -535,7 +535,7 @@ namespace Microsoft.AspNet.Authentication.JwtBearer private static TestServer CreateServer(JwtBearerOptions options, Func handler = null) { - var builder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .Configure(app => { if (options != null) diff --git a/test/Microsoft.AspNet.Authentication.Test/MicrosoftAccount/MicrosoftAccountMiddlewareTests.cs b/test/Microsoft.AspNet.Authentication.Test/MicrosoftAccount/MicrosoftAccountMiddlewareTests.cs index 29f6e0edcc..6d41f5a7a6 100644 --- a/test/Microsoft.AspNet.Authentication.Test/MicrosoftAccount/MicrosoftAccountMiddlewareTests.cs +++ b/test/Microsoft.AspNet.Authentication.Test/MicrosoftAccount/MicrosoftAccountMiddlewareTests.cs @@ -174,7 +174,7 @@ namespace Microsoft.AspNet.Authentication.Tests.MicrosoftAccount private static TestServer CreateServer(MicrosoftAccountOptions options) { - var builder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .Configure(app => { app.UseCookieAuthentication(new CookieAuthenticationOptions diff --git a/test/Microsoft.AspNet.Authentication.Test/OpenIdConnect/OpenIdConnectHandlerTests.cs b/test/Microsoft.AspNet.Authentication.Test/OpenIdConnect/OpenIdConnectHandlerTests.cs index 0166c13e48..fa49055391 100644 --- a/test/Microsoft.AspNet.Authentication.Test/OpenIdConnect/OpenIdConnectHandlerTests.cs +++ b/test/Microsoft.AspNet.Authentication.Test/OpenIdConnect/OpenIdConnectHandlerTests.cs @@ -98,7 +98,7 @@ namespace Microsoft.AspNet.Authentication.Tests.OpenIdConnect private static TestServer CreateServer(OpenIdConnectOptions options, UrlEncoder encoder, OpenIdConnectHandler handler = null) { - var builder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .Configure(app => { app.UseMiddleware(Options.Create(options), encoder, handler); diff --git a/test/Microsoft.AspNet.Authentication.Test/OpenIdConnect/OpenIdConnectMiddlewareTests.cs b/test/Microsoft.AspNet.Authentication.Test/OpenIdConnect/OpenIdConnectMiddlewareTests.cs index 992f7b9c90..6661eeb542 100644 --- a/test/Microsoft.AspNet.Authentication.Test/OpenIdConnect/OpenIdConnectMiddlewareTests.cs +++ b/test/Microsoft.AspNet.Authentication.Test/OpenIdConnect/OpenIdConnectMiddlewareTests.cs @@ -377,7 +377,7 @@ namespace Microsoft.AspNet.Authentication.Tests.OpenIdConnect private static TestServer CreateServer(OpenIdConnectOptions options, Func handler = null, AuthenticationProperties properties = null) { - var builder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .Configure(app => { app.UseCookieAuthentication(new CookieAuthenticationOptions diff --git a/test/Microsoft.AspNet.Authentication.Test/Twitter/TwitterMiddlewareTests.cs b/test/Microsoft.AspNet.Authentication.Test/Twitter/TwitterMiddlewareTests.cs index 2d00d617de..173de5a82b 100644 --- a/test/Microsoft.AspNet.Authentication.Test/Twitter/TwitterMiddlewareTests.cs +++ b/test/Microsoft.AspNet.Authentication.Test/Twitter/TwitterMiddlewareTests.cs @@ -152,7 +152,7 @@ namespace Microsoft.AspNet.Authentication.Twitter private static TestServer CreateServer(TwitterOptions options, Func handler = null) { - var builder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .Configure(app => { app.UseCookieAuthentication(new CookieAuthenticationOptions diff --git a/test/Microsoft.AspNet.CookiePolicy.Test/CookiePolicyTests.cs b/test/Microsoft.AspNet.CookiePolicy.Test/CookiePolicyTests.cs index d0639e627d..f8529e0191 100644 --- a/test/Microsoft.AspNet.CookiePolicy.Test/CookiePolicyTests.cs +++ b/test/Microsoft.AspNet.CookiePolicy.Test/CookiePolicyTests.cs @@ -145,7 +145,7 @@ namespace Microsoft.AspNet.CookiePolicy.Test [Fact] public async Task CookiePolicyCanHijackAppend() { - var builder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .Configure(app => { app.UseCookiePolicy(new CookiePolicyOptions @@ -175,7 +175,7 @@ namespace Microsoft.AspNet.CookiePolicy.Test [Fact] public async Task CookiePolicyCanHijackDelete() { - var builder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .Configure(app => { app.UseCookiePolicy(new CookiePolicyOptions @@ -203,7 +203,7 @@ namespace Microsoft.AspNet.CookiePolicy.Test [Fact] public async Task CookiePolicyCallsCookieFeature() { - var builder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .Configure(app => { app.Use(next => context => @@ -282,7 +282,7 @@ namespace Microsoft.AspNet.CookiePolicy.Test RequestDelegate configureSetup, params RequestTest[] tests) { - var builder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .Configure(app => { app.Map(path, map => diff --git a/test/Microsoft.Owin.Security.Interop.Test/CookieInteropTests.cs b/test/Microsoft.Owin.Security.Interop.Test/CookieInteropTests.cs index c7645a2874..996e181607 100644 --- a/test/Microsoft.Owin.Security.Interop.Test/CookieInteropTests.cs +++ b/test/Microsoft.Owin.Security.Interop.Test/CookieInteropTests.cs @@ -52,7 +52,7 @@ namespace Microsoft.Owin.Security.Interop var transaction = await SendAsync(interopServer, "http://example.com"); - var builder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .Configure(app => { app.UseCookieAuthentication(new AspNet.Builder.CookieAuthenticationOptions @@ -88,7 +88,7 @@ namespace Microsoft.Owin.Security.Interop "Microsoft.AspNet.Authentication.Cookies.CookieAuthenticationMiddleware", // full name of the ASP.NET 5 type CookieAuthenticationDefaults.AuthenticationType, "v2"); - var builder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .Configure(app => { app.UseCookieAuthentication(new AspNet.Builder.CookieAuthenticationOptions