ProcessStartInfo hanging on “WaitForExit”? Why?

前端 未结 22 2130
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-22 02:59

I have the following code:

info = new System.Diagnostics.ProcessStartInfo(\"TheProgram.exe\", String.Join(\" \", args));
info.CreateNoWindow = true;
info.Win         


        
22条回答
  •  时光取名叫无心
    2020-11-22 03:19

    We have this issue as well (or a variant).

    Try the following:

    1) Add a timeout to p.WaitForExit(nnnn); where nnnn is in milliseconds.

    2) Put the ReadToEnd call before the WaitForExit call. This is what we've seen MS recommend.

提交回复
热议问题