Allow for an alternate application name to be used as part of deployment. (#945)

This lets us test applications that are compiled with a different assembly name
This commit is contained in:
Pranav K 2017-02-15 17:20:16 -08:00 committed by David Fowler
parent 75a0b9889a
commit c4ea355ddf
2 changed files with 8 additions and 1 deletions

View File

@ -41,6 +41,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
}
ApplicationPath = applicationPath;
ApplicationName = new DirectoryInfo(ApplicationPath).Name;
ServerType = serverType;
RuntimeFlavor = runtimeFlavor;
EnvironmentVariables.Add(new KeyValuePair<string, string>("ASPNETCORE_DETAILEDERRORS", "true"));
@ -69,6 +70,12 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
public string ApplicationPath { get; }
/// <summary>
/// Gets or sets the name of the application. This is used to execute the application when deployed.
/// Defaults to the file name of <see cref="ApplicationPath"/>.
/// </summary>
public string ApplicationName { get; set; }
public string TargetFramework { get; set; }
/// <summary>

View File

@ -57,7 +57,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
var executableExtension =
DeploymentParameters.RuntimeFlavor == RuntimeFlavor.Clr ? ".exe" :
DeploymentParameters.ApplicationType == ApplicationType.Portable ? ".dll" : "";
var executable = Path.Combine(DeploymentParameters.PublishedApplicationRootPath, new DirectoryInfo(DeploymentParameters.ApplicationPath).Name + executableExtension);
var executable = Path.Combine(DeploymentParameters.PublishedApplicationRootPath, DeploymentParameters.ApplicationName + executableExtension);
if (DeploymentParameters.RuntimeFlavor == RuntimeFlavor.Clr && !RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{