开发者

Different behavior with running psexec from WPF app when executing from command line vs. double-click

I am using process.Start to execute psexec which executes an msi remotely.

For some reason, process.StandardOutput.ReadToEnd() hangs when I double-clicked on the a开发者_如何学Gopplication, but when I execute the WPF app from a command prompt it is fine.

Anybody have any ideas?

Thanks.


I believe you are blocking on the synchronous ReadToEnd call. You might want to use Process.BeginOutputReadLine instead because it's asynchronous: http://msdn.microsoft.com/en-us/library/system.diagnostics.process.beginoutputreadline.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜