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}");