From c4ea355ddfbe37234393af798b69943ee0ba649a Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 15 Feb 2017 17:20:16 -0800 Subject: [PATCH] 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 --- .../Common/DeploymentParameters.cs | 7 +++++++ .../Deployers/SelfHostDeployer.cs | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/DeploymentParameters.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/DeploymentParameters.cs index 54c2517919..d662cef8a7 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/DeploymentParameters.cs +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/DeploymentParameters.cs @@ -41,6 +41,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting } ApplicationPath = applicationPath; + ApplicationName = new DirectoryInfo(ApplicationPath).Name; ServerType = serverType; RuntimeFlavor = runtimeFlavor; EnvironmentVariables.Add(new KeyValuePair("ASPNETCORE_DETAILEDERRORS", "true")); @@ -69,6 +70,12 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting public string ApplicationPath { get; } + /// + /// Gets or sets the name of the application. This is used to execute the application when deployed. + /// Defaults to the file name of . + /// + public string ApplicationName { get; set; } + public string TargetFramework { get; set; } /// diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/SelfHostDeployer.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/SelfHostDeployer.cs index 58b59f776d..656d10d9f0 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/SelfHostDeployer.cs +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/SelfHostDeployer.cs @@ -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)) {