Starting a process from a .NET windows service

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

I use Process.Start to start the console application and it starts (I see it in the mgr command), but I never return the process ID and the call to Process.Start just hangs. If I start the same service from my Windows 7 machine, the process runs and I return the process ID without problems.

I'm confused..

+7
c # windows service
source share
3 answers

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

+5
source share

Is it possible that the process you are creating is trying to request a window station for user input? In this case, it may freeze ...

What process are you starting? Is it part of a platform / OS (e.g. cmd.exe) or something common?

+1
source share

After a long search for a solution to this, I found wise stones for my problem.

I created a new program based on WindowsForm with the same Process.Start command, and then the standard Windows Alert dialog box appears, and therefore it works as an assistant professor.

After turning off "User Access Control", the Windows service works correctly.

0
source share

All Articles