简体   繁体   English

从子控制台进程重定向到父控制台进程的控制台输出失败

[英]Redirected Console Output from a Child Console Process to a Parent Console Process Fails

I have a console program as a parent process which runs several sub-processes which are also console programs. 我有一个控制台程序作为父进程,它运行几个子进程,这些子进程也是控制台程序。 For the child processes, output is redirected to a pair of StringBuilder objects (one for STDOUT and one for STDERR.). 对于子进程,将输出重定向到一对StringBuilder对象(一个用于STDOUT,一个用于STDERR)。 Upon completion of a child process, its output is appended to the parent's output (also accrued in a pair of StringBuilder's.) 子进程完成后,其输出将附加到父进程的输出(也累积在一对StringBuilder的输出中)。

I recently added a new child process and it does not work. 我最近添加了一个新的子进程,它无法正常工作。 It doesn't fail either. 它也不会失败。 I can't seem to debug it since no output statements in the child process work. 我似乎无法调试它,因为子进程中没有输出语句。 I have spent a day trying to figure this out. 我花了一天的时间试图弄清楚这一点。 Things are complicated a bit since the execution platform is on another server under control of the JAMS Scheduler. 由于执行平台在JAMS Scheduler的控制下在另一台服务器上,因此事情有点复杂。

The new child process used the most recent dotnet framework loaded on my development system - 4.6.1. 新的子进程使用了​​开发系统上加载的最新dotnet框架-4.6.1。 The master process and the older child processes used 4.5.1. 主进程和较旧的子进程使用4.5.1。 I verified using the dword "Release" at registry key "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full" that 4.6.1 was indeed installed on the server. 我使用注册表项“ HKEY_LOCAL_MACHINE \\ SOFTWARE \\ Microsoft \\ NET Framework Setup \\ NDP \\ v4 \\ Full”上的双字“ Release”验证了确实在服务器上安装了4.6.1。

I changed the version of the new project to match the parent project (and other child projects), rebuilt and redeployed it and everything started working. 我更改了新项目的版本以使其与父项目(以及其他子项目)匹配,对其进行了重新构建和重新部署,一切开始正常工作。

Hopefully, this will save one person a day of their life. 希望这将挽救一个人的生命。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM