Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions src/Servers/IIS/IntegrationTesting.IIS/src/IISExpressDeployer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,16 +167,9 @@ private string CheckIfPublishIsRequired()
Logger.LogInformation("Attempting to start IIS Express on port: {port}", port);
PrepareConfig(contentRoot, port);

var parameters = string.IsNullOrEmpty(DeploymentParameters.ServerConfigLocation) ?
string.Format(CultureInfo.InvariantCulture, "/port:{0} /path:\"{1}\" /trace:error /systray:false", uri.Port, contentRoot) :
string.Format(CultureInfo.InvariantCulture, "/site:{0} /config:{1} /trace:error /systray:false", DeploymentParameters.SiteName, DeploymentParameters.ServerConfigLocation);

Logger.LogInformation("Executing command : {iisExpress} {parameters}", iisExpressPath, parameters);

var startInfo = new ProcessStartInfo
{
FileName = iisExpressPath,
Arguments = parameters,
UseShellExecute = false,
CreateNoWindow = true,
RedirectStandardError = true,
Expand All @@ -185,6 +178,23 @@ private string CheckIfPublishIsRequired()
WorkingDirectory = Path.GetDirectoryName(iisExpressPath)
};

if (string.IsNullOrEmpty(DeploymentParameters.ServerConfigLocation))
{
startInfo.ArgumentList.Add("/port:" + uri.Port.ToString(CultureInfo.InvariantCulture));
startInfo.ArgumentList.Add("/path:" + contentRoot);
startInfo.ArgumentList.Add("/trace:error");
startInfo.ArgumentList.Add("/systray:false");
}
else
{
startInfo.ArgumentList.Add("/site:" + DeploymentParameters.SiteName);
startInfo.ArgumentList.Add("/config:" + DeploymentParameters.ServerConfigLocation);
startInfo.ArgumentList.Add("/trace:error");
startInfo.ArgumentList.Add("/systray:false");
}

Logger.LogInformation("Executing command : {iisExpress} {parameters}", iisExpressPath, string.Join(" ", startInfo.ArgumentList));

AddEnvironmentVariablesToProcess(startInfo, DeploymentParameters.EnvironmentVariables);

Uri url = null;
Expand Down