From 1aa5ebc585422834b21d052487247e58d3ace3d3 Mon Sep 17 00:00:00 2001 From: Kiran Challa Date: Mon, 8 Aug 2016 13:27:23 -0700 Subject: [PATCH] ApplicationDeployer: Supply the build configuration to dotnet publish --- .../Common/DeploymentParameters.cs | 5 +++++ .../Deployers/ApplicationDeployer.cs | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.AspNetCore.Server.Testing/Common/DeploymentParameters.cs b/src/Microsoft.AspNetCore.Server.Testing/Common/DeploymentParameters.cs index 5118c465b6..ceba263673 100644 --- a/src/Microsoft.AspNetCore.Server.Testing/Common/DeploymentParameters.cs +++ b/src/Microsoft.AspNetCore.Server.Testing/Common/DeploymentParameters.cs @@ -71,6 +71,11 @@ namespace Microsoft.AspNetCore.Server.Testing public string TargetFramework { get; set; } + /// + /// Configuration under which to build (ex: Release or Debug) + /// + public string Configuration { get; set; } = "Debug"; + /// /// To publish the application before deployment. /// diff --git a/src/Microsoft.AspNetCore.Server.Testing/Deployers/ApplicationDeployer.cs b/src/Microsoft.AspNetCore.Server.Testing/Deployers/ApplicationDeployer.cs index 781a07ecf6..089efeff76 100644 --- a/src/Microsoft.AspNetCore.Server.Testing/Deployers/ApplicationDeployer.cs +++ b/src/Microsoft.AspNetCore.Server.Testing/Deployers/ApplicationDeployer.cs @@ -48,8 +48,9 @@ namespace Microsoft.AspNetCore.Server.Testing DeploymentParameters.PublishedApplicationRootPath = publishRoot ?? Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); var parameters = $"publish \"{DeploymentParameters.ApplicationPath}\"" - + $" -o \"{DeploymentParameters.PublishedApplicationRootPath}\"" - + $" --framework {DeploymentParameters.TargetFramework}"; + + $" --output \"{DeploymentParameters.PublishedApplicationRootPath}\"" + + $" --framework {DeploymentParameters.TargetFramework}" + + $" --configuration {DeploymentParameters.Configuration}"; Logger.LogInformation($"Executing command {DotnetCommandName} {parameters}");