diff --git a/src/Microsoft.AspNet.Server.Testing/Deployers/ApplicationDeployer.cs b/src/Microsoft.AspNet.Server.Testing/Deployers/ApplicationDeployer.cs index a5505c169c..27c1ff131c 100644 --- a/src/Microsoft.AspNet.Server.Testing/Deployers/ApplicationDeployer.cs +++ b/src/Microsoft.AspNet.Server.Testing/Deployers/ApplicationDeployer.cs @@ -78,11 +78,12 @@ namespace Microsoft.AspNet.Server.Testing DeploymentParameters.DnxRuntime, DeploymentParameters.PublishWithNoSource ? "--no-source" : string.Empty); - Logger.LogInformation("Executing command dnu {args}", parameters); + var dnuPath = Path.Combine(ChosenRuntimePath, "dnu.cmd"); + Logger.LogInformation("Executing command {dnu} {args}", dnuPath, parameters); var startInfo = new ProcessStartInfo { - FileName = Path.Combine(ChosenRuntimePath, "dnu.cmd"), + FileName = dnuPath, Arguments = parameters, UseShellExecute = false, CreateNoWindow = true @@ -91,6 +92,11 @@ namespace Microsoft.AspNet.Server.Testing var hostProcess = Process.Start(startInfo); hostProcess.WaitForExit(60 * 1000); + if (hostProcess.ExitCode != 0) + { + throw new Exception("dnu publish exited with exit code : {0}"); + } + DeploymentParameters.ApplicationPath = (DeploymentParameters.ServerType == ServerType.IISExpress || DeploymentParameters.ServerType == ServerType.IISNativeModule || diff --git a/src/Microsoft.AspNet.Server.Testing/Deployers/SelfHostDeployer.cs b/src/Microsoft.AspNet.Server.Testing/Deployers/SelfHostDeployer.cs index 12252c8829..246e0ee3a6 100644 --- a/src/Microsoft.AspNet.Server.Testing/Deployers/SelfHostDeployer.cs +++ b/src/Microsoft.AspNet.Server.Testing/Deployers/SelfHostDeployer.cs @@ -48,11 +48,14 @@ namespace Microsoft.AspNet.Server.Testing private CancellationToken StartSelfHost() { var commandName = DeploymentParameters.ServerType == ServerType.WebListener ? "web" : "kestrel"; - Logger.LogInformation("Executing dnx.exe {appPath} {command} --server.urls {url}", DeploymentParameters.ApplicationPath, commandName, DeploymentParameters.ApplicationBaseUriHint); + var dnxPath = Path.Combine(ChosenRuntimePath, "dnx.exe"); + Logger.LogInformation("Executing {dnxexe} {appPath} {command} --server.urls {url}", + dnxPath, DeploymentParameters.ApplicationPath, + commandName, DeploymentParameters.ApplicationBaseUriHint); var startInfo = new ProcessStartInfo { - FileName = Path.Combine(ChosenRuntimePath, "dnx.exe"), + FileName = dnxPath, Arguments = string.Format("\"{0}\" {1} --server.urls {2}", DeploymentParameters.ApplicationPath, commandName, DeploymentParameters.ApplicationBaseUriHint), UseShellExecute = false, CreateNoWindow = true