From c72df2865c784446d41b98fc5d6cb8e46c995c4d Mon Sep 17 00:00:00 2001 From: Justin Kotalik Date: Tue, 1 May 2018 10:05:07 -0700 Subject: [PATCH] Check existence of ANCMV2 Path (#1397) --- .../Deployers/IISExpressDeployer.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/IISExpressDeployer.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/IISExpressDeployer.cs index 85ca880094..286e05859d 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/IISExpressDeployer.cs +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/IISExpressDeployer.cs @@ -119,11 +119,25 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting throw new FileNotFoundException("AspNetCoreModule could not be found.", ancmFile); } - Logger.LogDebug("Writing ANCMPath '{ancmPath}' to config", ancmFile); + Logger.LogDebug("Writing ANCMPath '{ancmFile}' to config", ancmFile); serverConfig = serverConfig.Replace("[ANCMPath]", ancmFile); } + if (serverConfig.Contains("[ANCMV2Path]")) + { + var ancmFile = Path.Combine(contentRoot, Is64BitHost ? @"x64\aspnetcorev2.dll" : @"x86\aspnetcorev2.dll"); + + if (!File.Exists(Environment.ExpandEnvironmentVariables(ancmFile))) + { + throw new FileNotFoundException("AspNetCoreModuleV2 could not be found.", ancmFile); + } + + Logger.LogDebug("Writing ANCMV2Path '{ancmFile}' to config", ancmFile); + serverConfig = + serverConfig.Replace("[ANCMV2Path]", ancmFile); + } + Logger.LogDebug("Writing ApplicationPhysicalPath '{applicationPhysicalPath}' to config", contentRoot); Logger.LogDebug("Writing Port '{port}' to config", port); serverConfig =