Copy ANCM into a separate folder to avoid copy races (#12103)
This commit is contained in:
parent
79823c7b9a
commit
71d39e59d6
|
|
@ -31,6 +31,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
|
||||||
|
|
||||||
internal static string HostableWebCoreLocation => Environment.ExpandEnvironmentVariables($@"%windir%\system32\inetsrv\{HWebCoreDll}");
|
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),
|
internal static string BasePath => Path.Combine(Path.GetDirectoryName(new Uri(typeof(TestServer).Assembly.CodeBase).AbsolutePath),
|
||||||
|
"ANCM",
|
||||||
Environment.Is64BitProcess ? "x64" : "x86");
|
Environment.Is64BitProcess ? "x64" : "x86");
|
||||||
|
|
||||||
internal static string AspNetCoreModuleLocation => Path.Combine(BasePath, AspNetCoreModuleDll);
|
internal static string AspNetCoreModuleLocation => Path.Combine(BasePath, AspNetCoreModuleDll);
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,11 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS
|
||||||
protected string GetAncmLocation()
|
protected string GetAncmLocation()
|
||||||
{
|
{
|
||||||
var ancmDllName = "aspnetcorev2.dll";
|
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);
|
var ancmFile = Path.Combine(AppContext.BaseDirectory, arch);
|
||||||
if (!File.Exists(Environment.ExpandEnvironmentVariables(ancmFile)))
|
if (!File.Exists(Environment.ExpandEnvironmentVariables(ancmFile)))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
|
|
||||||
<Target Name="AddRunNativeComponents" BeforeTargets="AssignTargetPaths" Condition="'$(BuildIisNativeProjects)' == 'true'">
|
<Target Name="AddRunNativeComponents" BeforeTargets="AssignTargetPaths" Condition="'$(BuildIisNativeProjects)' == 'true'">
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="%(ShimComponents.DllLocation)" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" Link="%(ShimComponents.Platform)\%(ShimComponents.PackageSubPath)\%(ShimComponents.NativeAsset).dll" />
|
<None Include="%(ShimComponents.DllLocation)" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" Link="ANCM\%(ShimComponents.Platform)\%(ShimComponents.PackageSubPath)\%(ShimComponents.NativeAsset).dll" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue