Check existence of ANCMV2 Path (#1397)

This commit is contained in:
Justin Kotalik 2018-05-01 10:05:07 -07:00 committed by GitHub
parent 4a177d6b35
commit c72df2865c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 1 deletions

View File

@ -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 =