diff --git a/src/Identity/test/Identity.FunctionalTests/Bootstrap3Tests/UIFramewrokAttributeTest.cs b/src/Identity/test/Identity.FunctionalTests/Bootstrap3Tests/UIFramewrokAttributeTest.cs index c771f8becf..97e5764d72 100644 --- a/src/Identity/test/Identity.FunctionalTests/Bootstrap3Tests/UIFramewrokAttributeTest.cs +++ b/src/Identity/test/Identity.FunctionalTests/Bootstrap3Tests/UIFramewrokAttributeTest.cs @@ -26,7 +26,7 @@ namespace Microsoft.AspNetCore.Identity.FunctionalTests.Bootstrap3Tests var hasV3Part = false; var hasV4Part = false; var factory = Factory.WithWebHostBuilder( - whb => whb.UseStartup().ConfigureServices( + whb => whb.ConfigureServices( services => services.AddMvc().ConfigureApplicationPartManager( apm => (hasV3Part, hasV4Part) = (HasPart(apm, "V3"), HasPart(apm, "V4"))))); diff --git a/src/Identity/test/Identity.FunctionalTests/Infrastructure/ServerFactory.cs b/src/Identity/test/Identity.FunctionalTests/Infrastructure/ServerFactory.cs index 95fafbedd1..8258bb2e74 100644 --- a/src/Identity/test/Identity.FunctionalTests/Infrastructure/ServerFactory.cs +++ b/src/Identity/test/Identity.FunctionalTests/Infrastructure/ServerFactory.cs @@ -37,13 +37,10 @@ namespace Microsoft.AspNetCore.Identity.FunctionalTests } public string BootstrapFrameworkVersion { get; set; } = "V4"; - private bool IsHelixCI => typeof(ServerFactory<,>).Assembly.GetCustomAttributes() - .Any(a => a.Key == "Microsoft.AspNetCore.Testing.IsHelixCI"); protected override IHostBuilder CreateHostBuilder() { - Program.UseStartup = false; - return base.CreateHostBuilder(); + return Program.CreateHostBuilder(new[] { "--use-startup=false" }); } protected override void ConfigureWebHost(IWebHostBuilder builder) diff --git a/src/Identity/testassets/Identity.DefaultUI.WebSite/Program.cs b/src/Identity/testassets/Identity.DefaultUI.WebSite/Program.cs index 44d81e4099..fcb1275b56 100644 --- a/src/Identity/testassets/Identity.DefaultUI.WebSite/Program.cs +++ b/src/Identity/testassets/Identity.DefaultUI.WebSite/Program.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.IO; +using System.Linq; using System.Reflection; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; @@ -17,13 +18,11 @@ namespace Identity.DefaultUI.WebSite CreateHostBuilder(args).Build().Run(); } - public static bool UseStartup { get; set; } = true; - public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { - if (UseStartup) + if (!args.Contains("--use-startup=false")) { webBuilder.UseStartup(); }