W
Wojtek
Hi,
I am having problems to fetch the output of a command line program from
an ASP.NET application. My code works fine in a regular Forms or command
line application, but when running the same code in ASP.NET it hangs
indefinitely. I can see in the Task Manager that the command line
started, but when going through it with the debugger it seems to hang
when calling the WaitForExit() method on the Process instance.
I can start any other program without any problem when avoiding the
WaitForExit() call. But without that call I can't fetch the output...
Here's the sample code:
ProcessStartInfo psi = new ProcessStartInfo();
psi.Arguments = "list http://testserver/svn/TestRepos";
psi.FileName = "svn.exe";
psi.CreateNoWindow = true;
psi.UseShellExecute = false;
psi.RedirectStandardError = true;
psi.RedirectStandardOutput = true;
Process p = new Process();
p.StartInfo = psi;
p.Start();
p.WaitForExit(); // <-- *** it hangs here ***
string output = p.StandardOutput.ReadToEnd();
Any ideas?
Thanks in advance,
Wojtek
I am having problems to fetch the output of a command line program from
an ASP.NET application. My code works fine in a regular Forms or command
line application, but when running the same code in ASP.NET it hangs
indefinitely. I can see in the Task Manager that the command line
started, but when going through it with the debugger it seems to hang
when calling the WaitForExit() method on the Process instance.
I can start any other program without any problem when avoiding the
WaitForExit() call. But without that call I can't fetch the output...
Here's the sample code:
ProcessStartInfo psi = new ProcessStartInfo();
psi.Arguments = "list http://testserver/svn/TestRepos";
psi.FileName = "svn.exe";
psi.CreateNoWindow = true;
psi.UseShellExecute = false;
psi.RedirectStandardError = true;
psi.RedirectStandardOutput = true;
Process p = new Process();
p.StartInfo = psi;
p.Start();
p.WaitForExit(); // <-- *** it hangs here ***
string output = p.StandardOutput.ReadToEnd();
Any ideas?
Thanks in advance,
Wojtek