diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISExpressDeployer.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISExpressDeployer.cs index 8139a0f6b9..8fe8c66585 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISExpressDeployer.cs +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISExpressDeployer.cs @@ -293,7 +293,8 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS ConfigureModuleAndBinding(config.Root, contentRoot, port); - if (!DeploymentParameters.PublishApplicationBeforeDeployment) + var webConfigPath = Path.Combine(contentRoot, "web.config"); + if (!DeploymentParameters.PublishApplicationBeforeDeployment && !File.Exists(webConfigPath)) { // The elements normally in the web.config are in the applicationhost.config for unpublished apps. AddAspNetCoreElement(config.Root); diff --git a/test/Common.FunctionalTests/OutOfProcess/HelloWorldTest.cs b/test/Common.FunctionalTests/OutOfProcess/HelloWorldTest.cs index 3f748f2314..edfd603e4c 100644 --- a/test/Common.FunctionalTests/OutOfProcess/HelloWorldTest.cs +++ b/test/Common.FunctionalTests/OutOfProcess/HelloWorldTest.cs @@ -66,7 +66,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests response = await deploymentResult.HttpClient.GetAsync("/Auth"); responseText = await response.Content.ReadAsStringAsync(); - Assert.True("backcompat;Windows".Equals(responseText) || "latest;null".Equals(responseText), "Auth"); + Assert.True("null".Equals(responseText), "Auth"); Assert.Equal( $"ContentRootPath {deploymentResult.ContentRoot}" + Environment.NewLine + diff --git a/test/IISExpress.FunctionalTests/OutOfProcess/WindowsAuthTests.cs b/test/IISExpress.FunctionalTests/WindowsAuthTests.cs similarity index 91% rename from test/IISExpress.FunctionalTests/OutOfProcess/WindowsAuthTests.cs rename to test/IISExpress.FunctionalTests/WindowsAuthTests.cs index b46b314d08..3720385d4c 100644 --- a/test/IISExpress.FunctionalTests/OutOfProcess/WindowsAuthTests.cs +++ b/test/IISExpress.FunctionalTests/WindowsAuthTests.cs @@ -26,7 +26,8 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests => TestMatrix.ForServers(DeployerSelector.ServerType) .WithTfms(Tfm.NetCoreApp22, Tfm.Net461) .WithAllApplicationTypes() - .WithAllAncmVersions(); + .WithAllAncmVersions() + .WithAllHostingModels(); [ConditionalTheory] [MemberData(nameof(TestVariants))] @@ -41,7 +42,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests var response = await deploymentResult.HttpClient.GetAsync("/Auth"); var responseText = await response.Content.ReadAsStringAsync(); - Assert.True("backcompat;Windows".Equals(responseText) || "latest;Windows".Equals(responseText), "Auth"); + Assert.Equal("Windows", responseText); } } } diff --git a/test/WebSites/OutOfProcessWebSite/Startup.cs b/test/WebSites/OutOfProcessWebSite/Startup.cs index 2547eb5735..a796f9a7a3 100644 --- a/test/WebSites/OutOfProcessWebSite/Startup.cs +++ b/test/WebSites/OutOfProcessWebSite/Startup.cs @@ -36,20 +36,6 @@ namespace TestSite public Task BodyLimit(HttpContext ctx) => ctx.Response.WriteAsync(ctx.Features.Get()?.MaxRequestBodySize?.ToString() ?? "null"); - public async Task Auth(HttpContext ctx) - { - var iisAuth = Environment.GetEnvironmentVariable("ASPNETCORE_IIS_HTTPAUTH"); - var authProvider = ctx.RequestServices.GetService(); - var authScheme = (await authProvider.GetAllSchemesAsync()).SingleOrDefault(); - if (string.IsNullOrEmpty(iisAuth)) - { - await ctx.Response.WriteAsync("backcompat;" + (authScheme?.Name ?? "null")); - } - else - { - await ctx.Response.WriteAsync("latest;" + (authScheme?.Name ?? "null")); - } - } public Task HelloWorld(HttpContext ctx) => ctx.Response.WriteAsync("Hello World"); diff --git a/test/WebSites/shared/SharedStartup/Startup.shared.cs b/test/WebSites/shared/SharedStartup/Startup.shared.cs index eef8f8bf7e..a804449029 100644 --- a/test/WebSites/shared/SharedStartup/Startup.shared.cs +++ b/test/WebSites/shared/SharedStartup/Startup.shared.cs @@ -2,7 +2,9 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Linq; using System.Threading.Tasks; +using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; @@ -33,5 +35,13 @@ namespace TestSite await ctx.Response.WriteAsync("Hello World"); } + + public async Task Auth(HttpContext ctx) + { + var authProvider = ctx.RequestServices.GetService(); + var authScheme = (await authProvider.GetAllSchemesAsync()).SingleOrDefault(); + + await ctx.Response.WriteAsync(authScheme?.Name ?? "null"); + } } }