I have a windows service, written in c# and I need to run a console application from it.
Console application also written in c#.
Console application is running fine when it is run not from windows service. When it is ran from ws it doesn`t do anything it should and as it should work for 10-20 seconds I see in debug code is executed at once.
I`m starting my console app with the following code:
proc.Start(fullPathToConsole, args);
proc.WaitForExit();
the path to console is right and when I`m trying to run it from the cmd or just in explorer (without args) it works fine. But after running with the service I see no effect.
I already tried to go to service properties and give it access to desktop and run under both system and my user (also specified in service properties). All remains the same.
ADDITION: I know service do not have ui and I don't want one. I want service to run console application. No need to get any data from it or use this console like ui, just run it to do it`s job.
UPDATE I: discovered, that running calc or any other windows app is easy. But still can`t run cmd or any console app. Actually I need to run it on XP SP2 and Windows 2003 Server. So do not need to interact with Vista in anyway.
Would be glad to any comments!
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…