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:
parent
75a0b9889a
commit
c4ea355ddf
|
|
@ -41,6 +41,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
|
||||||
}
|
}
|
||||||
|
|
||||||
ApplicationPath = applicationPath;
|
ApplicationPath = applicationPath;
|
||||||
|
ApplicationName = new DirectoryInfo(ApplicationPath).Name;
|
||||||
ServerType = serverType;
|
ServerType = serverType;
|
||||||
RuntimeFlavor = runtimeFlavor;
|
RuntimeFlavor = runtimeFlavor;
|
||||||
EnvironmentVariables.Add(new KeyValuePair<string, string>("ASPNETCORE_DETAILEDERRORS", "true"));
|
EnvironmentVariables.Add(new KeyValuePair<string, string>("ASPNETCORE_DETAILEDERRORS", "true"));
|
||||||
|
|
@ -69,6 +70,12 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
|
||||||
|
|
||||||
public string ApplicationPath { get; }
|
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; }
|
public string TargetFramework { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
|
||||||
var executableExtension =
|
var executableExtension =
|
||||||
DeploymentParameters.RuntimeFlavor == RuntimeFlavor.Clr ? ".exe" :
|
DeploymentParameters.RuntimeFlavor == RuntimeFlavor.Clr ? ".exe" :
|
||||||
DeploymentParameters.ApplicationType == ApplicationType.Portable ? ".dll" : "";
|
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))
|
if (DeploymentParameters.RuntimeFlavor == RuntimeFlavor.Clr && !RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue