Redirect IO when running parent-child processes as Windows Service
I have program that invokes a C# child process. The parent and child communicates through stdio. For the child, I make use of System.Console.In and System.Console.Out to read and write message from the parent. I run this on windows cmd console, it works good.
I then installed the parent program as a Windows Service, redirect IO at the parent side and starts开发者_如何学编程 the service. Service runs, it starts the parent process and then this created the child process. However, in this mode, parent and child fail to communicate. Child does not receive any message through the standard io.
Is it because I'm using System.Console that cause it to break when running as service? If I don't System.Console, what can be used so that it works in both modes?
Thanks
The Ideal here would be WCF and Named Pipes. Alternatively, using MSMQ would also work, and enable remote use.
精彩评论