My problem is multi-layered. I wanted to write a windows service that executes a SoapUI testrunner.bat batch file with custom parameters.
The service installs fine however it can’t be started unless it was built in Release mode. If I build it in Debug mode, install and attempt to start it, it fails to start.
I can’t debug because the “Attach to process” button is grayed out.
Now, the biggest problem is that when the service is started, it doesn’t appear to be doing anything at all. No log files are generated.
Here’s my code:
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = "D:\\testrunner.bat";
proc.StartInfo.Arguments = "-sServiceTest1 -cLoadBalancingTest -r -fd:\\temp -R\"TestCase Report\" -FPDF D:\\TestProj.xml";
proc.StartInfo.UseShellExecute = true;
proc.Start();
What am I doing wrong?
P.S. I’m running Windows 7.
To answer my own question, one of the reasons why nothing worked is because I misconfigured the service installer.
The code above works fine although I did install it by hand using installutil