Reacting to hosting rename

This commit is contained in:
John Luo 2016-01-17 17:09:38 -08:00
parent 10fdfcc5c8
commit 0f9875df0a
16 changed files with 42 additions and 41 deletions

1
.gitignore vendored
View File

@ -27,3 +27,4 @@ nuget.exe
project.lock.json project.lock.json
.build/ .build/
.testPublish/ .testPublish/
/.vs/

View File

@ -44,13 +44,13 @@ namespace CookieSample
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();
} }
} }
} }

View File

@ -54,13 +54,13 @@ namespace CookieSessionSample
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();
} }
} }
} }

View File

@ -114,13 +114,13 @@ namespace JwtBearerSample
// Entry point for the application. // Entry point for the application.
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();
} }
} }
} }

View File

@ -67,13 +67,13 @@ namespace OpenIdConnectSample
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();
} }
} }
} }

View File

@ -325,13 +325,13 @@ namespace CookieSample
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();
} }
} }
} }

View File

@ -854,7 +854,7 @@ namespace Microsoft.AspNet.Authentication.Cookies
[Fact] [Fact]
public async Task MapWillNotAffectChallenge() public async Task MapWillNotAffectChallenge()
{ {
var builder = new WebApplicationBuilder() var builder = new WebHostBuilder()
.Configure(app => .Configure(app =>
{ {
app.UseCookieAuthentication(new CookieAuthenticationOptions app.UseCookieAuthentication(new CookieAuthenticationOptions
@ -878,7 +878,7 @@ namespace Microsoft.AspNet.Authentication.Cookies
[Fact] [Fact]
public async Task ChallengeDoesNotSet401OnUnauthorized() public async Task ChallengeDoesNotSet401OnUnauthorized()
{ {
var builder = new WebApplicationBuilder() var builder = new WebHostBuilder()
.Configure(app => .Configure(app =>
{ {
app.UseCookieAuthentication(); app.UseCookieAuthentication();
@ -897,7 +897,7 @@ namespace Microsoft.AspNet.Authentication.Cookies
[Fact] [Fact]
public async Task UseCookieWithInstanceDoesntUseSharedOptions() public async Task UseCookieWithInstanceDoesntUseSharedOptions()
{ {
var builder = new WebApplicationBuilder() var builder = new WebHostBuilder()
.Configure(app => .Configure(app =>
{ {
app.UseCookieAuthentication(new CookieAuthenticationOptions app.UseCookieAuthentication(new CookieAuthenticationOptions
@ -919,7 +919,7 @@ namespace Microsoft.AspNet.Authentication.Cookies
[Fact] [Fact]
public async Task MapWithSignInOnlyRedirectToReturnUrlOnLoginPath() public async Task MapWithSignInOnlyRedirectToReturnUrlOnLoginPath()
{ {
var builder = new WebApplicationBuilder() var builder = new WebHostBuilder()
.Configure(app => .Configure(app =>
{ {
app.UseCookieAuthentication(new CookieAuthenticationOptions app.UseCookieAuthentication(new CookieAuthenticationOptions
@ -940,7 +940,7 @@ namespace Microsoft.AspNet.Authentication.Cookies
[Fact] [Fact]
public async Task MapWillNotAffectSignInRedirectToReturnUrl() public async Task MapWillNotAffectSignInRedirectToReturnUrl()
{ {
var builder = new WebApplicationBuilder() var builder = new WebHostBuilder()
.Configure(app => .Configure(app =>
{ {
app.UseCookieAuthentication(new CookieAuthenticationOptions app.UseCookieAuthentication(new CookieAuthenticationOptions
@ -965,7 +965,7 @@ namespace Microsoft.AspNet.Authentication.Cookies
[Fact] [Fact]
public async Task MapWithSignOutOnlyRedirectToReturnUrlOnLogoutPath() public async Task MapWithSignOutOnlyRedirectToReturnUrlOnLogoutPath()
{ {
var builder = new WebApplicationBuilder() var builder = new WebHostBuilder()
.Configure(app => .Configure(app =>
{ {
app.UseCookieAuthentication(new CookieAuthenticationOptions app.UseCookieAuthentication(new CookieAuthenticationOptions
@ -985,7 +985,7 @@ namespace Microsoft.AspNet.Authentication.Cookies
[Fact] [Fact]
public async Task MapWillNotAffectSignOutRedirectToReturnUrl() public async Task MapWillNotAffectSignOutRedirectToReturnUrl()
{ {
var builder = new WebApplicationBuilder() var builder = new WebHostBuilder()
.Configure(app => .Configure(app =>
{ {
app.UseCookieAuthentication(new CookieAuthenticationOptions app.UseCookieAuthentication(new CookieAuthenticationOptions
@ -1009,7 +1009,7 @@ namespace Microsoft.AspNet.Authentication.Cookies
[Fact] [Fact]
public async Task MapWillNotAffectAccessDenied() public async Task MapWillNotAffectAccessDenied()
{ {
var builder = new WebApplicationBuilder() var builder = new WebHostBuilder()
.Configure(app => .Configure(app =>
{ {
app.UseCookieAuthentication(new CookieAuthenticationOptions app.UseCookieAuthentication(new CookieAuthenticationOptions
@ -1031,7 +1031,7 @@ namespace Microsoft.AspNet.Authentication.Cookies
[Fact] [Fact]
public async Task NestedMapWillNotAffectLogin() public async Task NestedMapWillNotAffectLogin()
{ {
var builder = new WebApplicationBuilder() var builder = new WebHostBuilder()
.Configure(app => .Configure(app =>
app.Map("/base", map => app.Map("/base", map =>
{ {
@ -1055,7 +1055,7 @@ namespace Microsoft.AspNet.Authentication.Cookies
[Fact] [Fact]
public async Task NestedMapWillNotAffectAccessDenied() public async Task NestedMapWillNotAffectAccessDenied()
{ {
var builder = new WebApplicationBuilder() var builder = new WebHostBuilder()
.Configure(app => .Configure(app =>
app.Map("/base", map => app.Map("/base", map =>
{ {
@ -1080,7 +1080,7 @@ namespace Microsoft.AspNet.Authentication.Cookies
{ {
var dp = new NoOpDataProtector(); var dp = new NoOpDataProtector();
var builder1 = new WebApplicationBuilder() var builder1 = new WebHostBuilder()
.Configure(app => .Configure(app =>
{ {
app.UseCookieAuthentication(new CookieAuthenticationOptions app.UseCookieAuthentication(new CookieAuthenticationOptions
@ -1099,7 +1099,7 @@ namespace Microsoft.AspNet.Authentication.Cookies
var transaction = await SendAsync(server1, "http://example.com/stuff"); var transaction = await SendAsync(server1, "http://example.com/stuff");
Assert.NotNull(transaction.SetCookie); Assert.NotNull(transaction.SetCookie);
var builder2 = new WebApplicationBuilder() var builder2 = new WebHostBuilder()
.Configure(app => .Configure(app =>
{ {
app.UseCookieAuthentication(new CookieAuthenticationOptions app.UseCookieAuthentication(new CookieAuthenticationOptions
@ -1162,7 +1162,7 @@ namespace Microsoft.AspNet.Authentication.Cookies
private static TestServer CreateServer(CookieAuthenticationOptions options, Func<HttpContext, Task> testpath = null, Uri baseAddress = null, ClaimsTransformationOptions claimsTransform = null) private static TestServer CreateServer(CookieAuthenticationOptions options, Func<HttpContext, Task> testpath = null, Uri baseAddress = null, ClaimsTransformationOptions claimsTransform = null)
{ {
var builder = new WebApplicationBuilder() var builder = new WebHostBuilder()
.Configure(app => .Configure(app =>
{ {
app.UseCookieAuthentication(options); app.UseCookieAuthentication(options);

View File

@ -229,7 +229,7 @@ namespace Microsoft.AspNet.Authentication.Facebook
private static TestServer CreateServer(Action<IApplicationBuilder> configure, Action<IServiceCollection> configureServices, Func<HttpContext, bool> handler) private static TestServer CreateServer(Action<IApplicationBuilder> configure, Action<IServiceCollection> configureServices, Func<HttpContext, bool> handler)
{ {
var builder = new WebApplicationBuilder() var builder = new WebHostBuilder()
.Configure(app => .Configure(app =>
{ {
if (configure != null) if (configure != null)

View File

@ -757,7 +757,7 @@ namespace Microsoft.AspNet.Authentication.Google
private static TestServer CreateServer(GoogleOptions options, Func<HttpContext, Task> testpath = null) private static TestServer CreateServer(GoogleOptions options, Func<HttpContext, Task> testpath = null)
{ {
var builder = new WebApplicationBuilder() var builder = new WebHostBuilder()
.Configure(app => .Configure(app =>
{ {
app.UseCookieAuthentication(new CookieAuthenticationOptions app.UseCookieAuthentication(new CookieAuthenticationOptions

View File

@ -535,7 +535,7 @@ namespace Microsoft.AspNet.Authentication.JwtBearer
private static TestServer CreateServer(JwtBearerOptions options, Func<HttpContext, bool> handler = null) private static TestServer CreateServer(JwtBearerOptions options, Func<HttpContext, bool> handler = null)
{ {
var builder = new WebApplicationBuilder() var builder = new WebHostBuilder()
.Configure(app => .Configure(app =>
{ {
if (options != null) if (options != null)

View File

@ -174,7 +174,7 @@ namespace Microsoft.AspNet.Authentication.Tests.MicrosoftAccount
private static TestServer CreateServer(MicrosoftAccountOptions options) private static TestServer CreateServer(MicrosoftAccountOptions options)
{ {
var builder = new WebApplicationBuilder() var builder = new WebHostBuilder()
.Configure(app => .Configure(app =>
{ {
app.UseCookieAuthentication(new CookieAuthenticationOptions app.UseCookieAuthentication(new CookieAuthenticationOptions

View File

@ -98,7 +98,7 @@ namespace Microsoft.AspNet.Authentication.Tests.OpenIdConnect
private static TestServer CreateServer(OpenIdConnectOptions options, UrlEncoder encoder, OpenIdConnectHandler handler = null) private static TestServer CreateServer(OpenIdConnectOptions options, UrlEncoder encoder, OpenIdConnectHandler handler = null)
{ {
var builder = new WebApplicationBuilder() var builder = new WebHostBuilder()
.Configure(app => .Configure(app =>
{ {
app.UseMiddleware<OpenIdConnectMiddlewareForTestingAuthenticate>(Options.Create(options), encoder, handler); app.UseMiddleware<OpenIdConnectMiddlewareForTestingAuthenticate>(Options.Create(options), encoder, handler);

View File

@ -377,7 +377,7 @@ namespace Microsoft.AspNet.Authentication.Tests.OpenIdConnect
private static TestServer CreateServer(OpenIdConnectOptions options, Func<HttpContext, Task> handler = null, AuthenticationProperties properties = null) private static TestServer CreateServer(OpenIdConnectOptions options, Func<HttpContext, Task> handler = null, AuthenticationProperties properties = null)
{ {
var builder = new WebApplicationBuilder() var builder = new WebHostBuilder()
.Configure(app => .Configure(app =>
{ {
app.UseCookieAuthentication(new CookieAuthenticationOptions app.UseCookieAuthentication(new CookieAuthenticationOptions

View File

@ -152,7 +152,7 @@ namespace Microsoft.AspNet.Authentication.Twitter
private static TestServer CreateServer(TwitterOptions options, Func<HttpContext, bool> handler = null) private static TestServer CreateServer(TwitterOptions options, Func<HttpContext, bool> handler = null)
{ {
var builder = new WebApplicationBuilder() var builder = new WebHostBuilder()
.Configure(app => .Configure(app =>
{ {
app.UseCookieAuthentication(new CookieAuthenticationOptions app.UseCookieAuthentication(new CookieAuthenticationOptions

View File

@ -145,7 +145,7 @@ namespace Microsoft.AspNet.CookiePolicy.Test
[Fact] [Fact]
public async Task CookiePolicyCanHijackAppend() public async Task CookiePolicyCanHijackAppend()
{ {
var builder = new WebApplicationBuilder() var builder = new WebHostBuilder()
.Configure(app => .Configure(app =>
{ {
app.UseCookiePolicy(new CookiePolicyOptions app.UseCookiePolicy(new CookiePolicyOptions
@ -175,7 +175,7 @@ namespace Microsoft.AspNet.CookiePolicy.Test
[Fact] [Fact]
public async Task CookiePolicyCanHijackDelete() public async Task CookiePolicyCanHijackDelete()
{ {
var builder = new WebApplicationBuilder() var builder = new WebHostBuilder()
.Configure(app => .Configure(app =>
{ {
app.UseCookiePolicy(new CookiePolicyOptions app.UseCookiePolicy(new CookiePolicyOptions
@ -203,7 +203,7 @@ namespace Microsoft.AspNet.CookiePolicy.Test
[Fact] [Fact]
public async Task CookiePolicyCallsCookieFeature() public async Task CookiePolicyCallsCookieFeature()
{ {
var builder = new WebApplicationBuilder() var builder = new WebHostBuilder()
.Configure(app => .Configure(app =>
{ {
app.Use(next => context => app.Use(next => context =>
@ -282,7 +282,7 @@ namespace Microsoft.AspNet.CookiePolicy.Test
RequestDelegate configureSetup, RequestDelegate configureSetup,
params RequestTest[] tests) params RequestTest[] tests)
{ {
var builder = new WebApplicationBuilder() var builder = new WebHostBuilder()
.Configure(app => .Configure(app =>
{ {
app.Map(path, map => app.Map(path, map =>

View File

@ -52,7 +52,7 @@ namespace Microsoft.Owin.Security.Interop
var transaction = await SendAsync(interopServer, "http://example.com"); var transaction = await SendAsync(interopServer, "http://example.com");
var builder = new WebApplicationBuilder() var builder = new WebHostBuilder()
.Configure(app => .Configure(app =>
{ {
app.UseCookieAuthentication(new AspNet.Builder.CookieAuthenticationOptions 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 "Microsoft.AspNet.Authentication.Cookies.CookieAuthenticationMiddleware", // full name of the ASP.NET 5 type
CookieAuthenticationDefaults.AuthenticationType, "v2"); CookieAuthenticationDefaults.AuthenticationType, "v2");
var builder = new WebApplicationBuilder() var builder = new WebHostBuilder()
.Configure(app => .Configure(app =>
{ {
app.UseCookieAuthentication(new AspNet.Builder.CookieAuthenticationOptions app.UseCookieAuthentication(new AspNet.Builder.CookieAuthenticationOptions