Update selfhost to specify server via command line

This commit is contained in:
John Luo 2015-12-21 14:37:04 -08:00
parent 94bf7bf2d5
commit 7b43502817
1 changed files with 7 additions and 2 deletions

View File

@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Threading;
@ -51,10 +52,14 @@ namespace Microsoft.AspNet.Server.Testing
var commandName = DeploymentParameters.Command;
if (string.IsNullOrEmpty(commandName))
{
commandName = DeploymentParameters.ServerType == ServerType.WebListener ? "weblistener" : "kestrel";
commandName = "run";
}
var dnxPath = Path.Combine(ChosenRuntimePath, DnxCommandName);
var dnxArgs = $"-p \"{DeploymentParameters.ApplicationPath}\" {commandName} --server.urls {DeploymentParameters.ApplicationBaseUriHint}";
var dnxArgs = $"-p \"{DeploymentParameters.ApplicationPath}\" {commandName} " +
$"--server.urls {DeploymentParameters.ApplicationBaseUriHint} " +
$"--server {(DeploymentParameters.ServerType == ServerType.WebListener ? "Microsoft.AspNet.Server.WebListener" : "Microsoft.AspNet.Server.Kestrel")}";
Logger.LogInformation($"Executing {dnxPath} {dnxArgs}");
var startInfo = new ProcessStartInfo