从.NET Windows服务启动流程 [英] starting a process from a .NET windows service
问题描述
我想开始从.NET Windows服务控制台应用程序。该服务在Windows 2008服务器上运行。
我用的Process.Start运行控制台应用程序,它运行(我可以看到它在任务经理),但我从来没有得到的进程id背部和调用的Process.Start只是挂起。 如果我运行从我的Windows 7计算机相同的服务的过程中运行,我得到的进程ID后面没有问题。
我很困惑。
解决方案我有完全同样的问题
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屋!