diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/DeploymentParameters.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/DeploymentParameters.cs index 23df8c8163..4687f8f330 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/DeploymentParameters.cs +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/DeploymentParameters.cs @@ -88,6 +88,11 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting /// public string AdditionalPublishParameters { get; set; } + /// + /// Publish restores by default, this property opts out by default. + /// + public bool RestoreOnPublish { get; set; } + /// /// To publish the application before deployment. /// diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/ApplicationDeployer.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/ApplicationDeployer.cs index d2370c9e27..15aa255e33 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/ApplicationDeployer.cs +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/ApplicationDeployer.cs @@ -54,7 +54,8 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting var parameters = $"publish " + $" --output \"{DeploymentParameters.PublishedApplicationRootPath}\"" + $" --framework {DeploymentParameters.TargetFramework}" - + $" --configuration {DeploymentParameters.Configuration}"; + + $" --configuration {DeploymentParameters.Configuration}" + + (DeploymentParameters.RestoreOnPublish ? "" : " --no-restore"); if (DeploymentParameters.ApplicationType == ApplicationType.Standalone) {