为什么从WCF调用到Process.Start不能以交互模式启动Remote Process? [英] Why Remote Process is not launching from WCF call to Process.Start in interactive mode?

查看:93
本文介绍了为什么从WCF调用到Process.Start不能以交互模式启动Remote Process?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有WCF服务,该服务从Process启动远程进程.在托管/部署和开发此WCF服务的独立计算机上成功启动.

我将此服务作为整体服务部署到另一台计算机上,并在该计算机上也运行该服务,在同一代码区上执行该服务,该代码远程启动该进程,这里失败了,行为奇怪.
我独立检查了进程状态,并正常启动了该进程,它执行得很好,并显示了写入该进程的进程内的消息框.

但是当通过代码从WCF调用启动此过程时,该过程未以交互方式启动,任务管理器显示了已启动的过程,但未显示其控制台,也未显示任何消息框.任何的想法 ?还是方法?

注意:当WCF服务与所有二进制文件完全部署在另一台计算机上时,会观察到此行为.


问候
Usman

I have WCF service which launches the remote process from Process.Start successfully on stand alone machine where this WCF service is hosted/deployed and developed.

I deployed this as whole service on another machine, and run the service on that machine as well, execute the service on the same code area which launches the process remotely, here it failed, Strange behavior.

I checked the process state stand alone , and launched the process normally, it executed fine and shown the message box inside that process which was written there.

BUT when this process launched via WCF call from code, process didn''t launched in interactive manner, Task Manager shown the launched process, but its console not shown, nor any message box shown . ANY IDEA ? or WAY AROUND?

Note : This behavior is observed when WCF service deployed completely with all binaries on another machine.


Regards
Usman

推荐答案

在启动应用程序的wcf代码周围放置一个try/catch块,并让wcf服务方法返回正在发生的异常. />
我认为,这是您找出正在发生的事情的唯一方法.

您还可以检查相关服务器上的系统日志,但是我怀疑这是否会有所帮助.
Put a try/catch block around the wcf code that launches the app, and have the wcf service method return the exception that''s occurring.

I think that''s the only way you''re going to find out what''s going on.

You can also check the system logs on the server in question, but I doubt that''s going to be helpful.


考虑一下,这一点也不奇怪.能够远程启动交互式过程将带来巨大的安全风险.因此,Windows不允许您这样做.就是这么简单.
It''s not strange at all if you think about it. It would be a HUGE security risk to be able to launch an interactive process remotely. So, Windows does not allow you to do that. It''s that simple.


这篇关于为什么从WCF调用到Process.Start不能以交互模式启动Remote Process?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆