Fixing start mono processstartinfo
This commit is contained in:
parent
938f98f7ce
commit
eabe6b1aa7
|
|
@ -186,21 +186,19 @@ namespace E2ETests
|
||||||
KpmPack(startParameters, logger);
|
KpmPack(startParameters, logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Mono does not have a way to pass in a --appbase switch. So it will be an environment variable.
|
//Mono now supports --appbase
|
||||||
Environment.SetEnvironmentVariable("DOTNET_APPBASE", startParameters.ApplicationPath);
|
Environment.SetEnvironmentVariable("DOTNET_APPBASE", startParameters.ApplicationPath);
|
||||||
logger.WriteInformation("Setting the DOTNET_APPBASE to {0}", startParameters.ApplicationPath);
|
logger.WriteInformation("Setting the --appbase to", startParameters.ApplicationPath);
|
||||||
|
|
||||||
var monoPath = "mono";
|
var dotnet = "dotnet";
|
||||||
var dotnetMonoManaged = Path.Combine(dotnetBin, "dotnet.mono.managed.dll");
|
|
||||||
var applicationHost = Path.Combine(dotnetBin, "Microsoft.Framework.ApplicationHost");
|
|
||||||
|
|
||||||
var commandName = startParameters.ServerType == ServerType.Kestrel ? "kestrel" : string.Empty;
|
var commandName = startParameters.ServerType == ServerType.Kestrel ? "kestrel" : string.Empty;
|
||||||
logger.WriteInformation(string.Format("Executing command: {0} {1} {2} {3}", monoPath, dotnetMonoManaged, applicationHost, commandName));
|
logger.WriteInformation(string.Format("Executing command: {0} {1} {2}", dotnet, startParameters.ApplicationPath, commandName));
|
||||||
|
|
||||||
var startInfo = new ProcessStartInfo
|
var startInfo = new ProcessStartInfo
|
||||||
{
|
{
|
||||||
FileName = monoPath,
|
FileName = dotnet,
|
||||||
Arguments = string.Format("{0} {1} {2}", dotnetMonoManaged, applicationHost, commandName),
|
Arguments = string.Format("{0} {1}", startParameters.ApplicationPath, commandName),
|
||||||
UseShellExecute = false,
|
UseShellExecute = false,
|
||||||
CreateNoWindow = true,
|
CreateNoWindow = true,
|
||||||
RedirectStandardInput = true
|
RedirectStandardInput = true
|
||||||
|
|
@ -210,8 +208,6 @@ namespace E2ETests
|
||||||
logger.WriteInformation("Started {0}. Process Id : {1}", hostProcess.MainModule.FileName, hostProcess.Id);
|
logger.WriteInformation("Started {0}. Process Id : {1}", hostProcess.MainModule.FileName, hostProcess.Id);
|
||||||
Thread.Sleep(25 * 1000);
|
Thread.Sleep(25 * 1000);
|
||||||
|
|
||||||
//Clear the appbase so that it does not create issues with successive runs
|
|
||||||
Environment.SetEnvironmentVariable("DOTNET_APPBASE", string.Empty);
|
|
||||||
return hostProcess;
|
return hostProcess;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue