diff --git a/src/Servers/IIS/IIS/test/IIS.Tests/Utilities/TestServer.cs b/src/Servers/IIS/IIS/test/IIS.Tests/Utilities/TestServer.cs index d688fd7413..37f871f6a7 100644 --- a/src/Servers/IIS/IIS/test/IIS.Tests/Utilities/TestServer.cs +++ b/src/Servers/IIS/IIS/test/IIS.Tests/Utilities/TestServer.cs @@ -31,6 +31,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests internal static string HostableWebCoreLocation => Environment.ExpandEnvironmentVariables($@"%windir%\system32\inetsrv\{HWebCoreDll}"); internal static string BasePath => Path.Combine(Path.GetDirectoryName(new Uri(typeof(TestServer).Assembly.CodeBase).AbsolutePath), + "ANCM", Environment.Is64BitProcess ? "x64" : "x86"); internal static string AspNetCoreModuleLocation => Path.Combine(BasePath, AspNetCoreModuleDll); diff --git a/src/Servers/IIS/IntegrationTesting.IIS/src/IISDeployerBase.cs b/src/Servers/IIS/IntegrationTesting.IIS/src/IISDeployerBase.cs index 143b491a6d..2b80e61d0c 100644 --- a/src/Servers/IIS/IntegrationTesting.IIS/src/IISDeployerBase.cs +++ b/src/Servers/IIS/IntegrationTesting.IIS/src/IISDeployerBase.cs @@ -85,7 +85,11 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS protected string GetAncmLocation() { var ancmDllName = "aspnetcorev2.dll"; - var arch = DeploymentParameters.RuntimeArchitecture == RuntimeArchitecture.x64 ? $@"x64\{ancmDllName}" : $@"x86\{ancmDllName}"; + // There are issues with having multiple dlls copy to the same location in both build and publish + // It's inherently racy. Therefore, we have two different copy locations and when trying verify backwards compat tests, + // we select the version of ANCM in a different folder. + var basePath = File.Exists(Path.Combine(AppContext.BaseDirectory, "x64", "aspnetcorev2.dll")) ? "" : @"ANCM\"; + var arch = DeploymentParameters.RuntimeArchitecture == RuntimeArchitecture.x64 ? $@"{basePath}x64\{ancmDllName}" : $@"{basePath}x86\{ancmDllName}"; var ancmFile = Path.Combine(AppContext.BaseDirectory, arch); if (!File.Exists(Environment.ExpandEnvironmentVariables(ancmFile))) { diff --git a/src/Servers/IIS/IntegrationTesting.IIS/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS.csproj b/src/Servers/IIS/IntegrationTesting.IIS/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS.csproj index 424be8c5f5..151796a365 100644 --- a/src/Servers/IIS/IntegrationTesting.IIS/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS.csproj +++ b/src/Servers/IIS/IntegrationTesting.IIS/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS.csproj @@ -44,7 +44,7 @@ - +