redirection of standard error does not work!

  • Thread starter Thread starter MR
  • Start date Start date
M

MR

i am creating a new thread and trying to redirect the standard error as
follows:

p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardError = true;
p.StartInfo = psi; //parameter string
p.Start();
string stdError = p.StandardError.ReadToEnd();

i get the following InvalidOperationException:
StandardError has not been redirected

am i leaving out a step or two?
thanks
m
 
MR said:
i am creating a new thread and trying to redirect the standard error as
follows:

p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardError = true;
p.StartInfo = psi; //parameter string
p.Start();
string stdError = p.StandardError.ReadToEnd();

i get the following InvalidOperationException:
StandardError has not been redirected

am i leaving out a step or two?

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top