Hey all,
I've create a console app that handles some pdf conversions for me. In this app I send some text to the console and if an error occurs, I send text to Console.Error...


VB.net Code:
  1. 'for console writes...
  2. Console.WriteLine("Converting page " & pageNumber.ToString)
  3.  
  4. 'for error writes...
  5.  Console.Error.WriteLine("An error occur during the pdf page conversion.")

I am then running the console app from a windForm app with this code...
VB.Net Code:
  1. Private Function pdfToImg(pdfPath As String, destinationPath As String, pdfToImgAppPath As String) As String
  2.  
  3.         Dim returnErrString As String = ""
  4.          Dim p As New Process
  5.         With p.StartInfo
  6.             .FileName = pdfToImgAppPath
  7.             .Arguments = String.Format("{0} {1}", pdfPath, destinationPath)
  8.             .RedirectStandardOutput = False
  9.             .RedirectStandardError = True
  10.             .UseShellExecute = False
  11.         End With
  12.         p.Start()
  13.         p.WaitForExit(30000)
  14.  
  15.         If Not p.HasExited Then
  16.             p.Kill()
  17.             returnErrString = "An unknow error has occured in the pdf conversion. The process never ended."
  18.         Else
  19.             returnErrString = p.StandardError.ReadToEnd
  20.         End If
  21.         Return returnErrString
  22.  
  23.     End Function
My intent is have the standard output go to the console, but redirect the error so I can display and log it, However when I set RedirectStandardError=True, it is redirecting all output including the standard output which I want to remain in the console window.

Has anyone seen this behavior before and know how to resolve it?
thanks
kevin