从.NET Windows服务启动流程 [英] starting a process from a .NET windows service

查看:215
本文介绍了从.NET Windows服务启动流程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想开始从.NET Windows服务控制台应用程序。该服务在Windows 2008服务器上运行。

我用的Process.Start运行控制台应用程序,它运行(我可以看到它在任务经理),但我从来没有得到的进程id背部和调用的Process.Start只是挂起。 如果我运行从我的Windows 7计算机相同的服务的过程中运行,我得到的进程ID后面没有问题。

我很困惑。

解决方案

我有完全同样的问题

。对我来说,关键是要设置StartInfo.UseShellExecute = FALSE;

I am trying to start a console application from a .NET Windows Service. The service is running on a Windows 2008 server.

I use Process.Start to run the console application and it runs( I can see it in the task mgr), but I never get the process id back and the call to Process.Start just hangs. If I run the same service from my Windows 7 machine the process runs and I get the process Id back no problem.

I am confused ..

解决方案

I had exactly this same problem. For me the key was to set StartInfo.UseShellExecute = false;

这篇关于从.NET Windows服务启动流程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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