From ac8a86ff3ffe7d7d8f8013eb8423a12ae031d4f3 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 5 Jan 2017 17:42:45 -0800 Subject: [PATCH] Skip specifying the project argument when running dotnet commands Workaround for https://github.com/dotnet/cli/issues/5168 and https://github.com/dotnet/cli/issues/5211 --- .../Deployers/ApplicationDeployer.cs | 5 +++-- .../Deployers/SelfHostDeployer.cs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/ApplicationDeployer.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/ApplicationDeployer.cs index 891ac56e96..e861cebc0a 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/ApplicationDeployer.cs +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/ApplicationDeployer.cs @@ -45,7 +45,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting DeploymentParameters.PublishedApplicationRootPath = publishRoot ?? Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); - var parameters = $"publish \"{DeploymentParameters.ApplicationPath}\"" + var parameters = $"publish " + $" --output \"{DeploymentParameters.PublishedApplicationRootPath}\"" + $" --framework {DeploymentParameters.TargetFramework}" + $" --configuration {DeploymentParameters.Configuration}"; @@ -59,7 +59,8 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting UseShellExecute = false, CreateNoWindow = true, RedirectStandardError = true, - RedirectStandardOutput = true + RedirectStandardOutput = true, + WorkingDirectory = DeploymentParameters.ApplicationPath, }; AddEnvironmentVariablesToProcess(startInfo, DeploymentParameters.PublishEnvironmentVariables); diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/SelfHostDeployer.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/SelfHostDeployer.cs index bd93d6cabb..58b59f776d 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/SelfHostDeployer.cs +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/SelfHostDeployer.cs @@ -80,7 +80,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting var targetFramework = DeploymentParameters.TargetFramework ?? (DeploymentParameters.RuntimeFlavor == RuntimeFlavor.Clr ? "net451" : "netcoreapp1.1"); executableName = DotnetCommandName; - executableArgs = $"run -p \"{DeploymentParameters.ApplicationPath}\" --framework {targetFramework} {DotnetArgumentSeparator}"; + executableArgs = $"run --framework {targetFramework} {DotnetArgumentSeparator}"; } executableArgs += $" --server.urls {uri} "