I'm docking Neo4j Docker images using Process
. I need to make sure that the images are docked properly before performing operations on it. As you can see here, I'm redirecting the standard output from the Docker Toolbox to my Process window and writing to it whatever the Docker Toolbox is doing. However, after the images are docked, it doesn't proceed at all and stays in that state. All codes beyond the while loop are not executed.
ProcessStartInfo psi = new ProcessStartInfo();
psi.WindowStyle = ProcessWindowStyle.Normal;
psi.FileName = ConfigurationManager.AppSettings["Bash"];
psi.WorkingDirectory = ConfigurationManager.AppSettings["ToolBox"];
psi.Arguments = BuildArgumentString();
psi.UseShellExecute = false;//set to false to redirect standard output
psi.RedirectStandardOutput = true;
Process process = Process.Start(psi);
StreamReader reader = process.StandardOutput;
while (!reader.EndOfStream)
{
Console.WriteLine(reader.ReadLine());
}
//codes beyond this while loop is not executed
This is the process window.