Windows service runs file locally but not on server
Posted
by Ben
on Server Fault
See other posts from Server Fault
or by Ben
Published on 2009-11-09T17:28:45Z
Indexed on
2010/03/24
14:03 UTC
Read the original article
Hit count: 444
I created a simple Windows service in dot net which runs a file. When I run the service locally I see the file running in the task manager just fine. However, when I run the service on the server it won't run the file. I've checked the path to the file which is fine. I also checked the permissions on the folder and file, and they fine as well. Also there are no exceptions happening. Below is the code used to launch the process which runs the file. I posted this first on stack overflow, and some people were thinking this is a config issue, so I moved it here. Any ideas?
try
{
// TODO: Add code here to start your service.
eventLog1.WriteEntry("VirtualCameraService started");
// Create An instance of the Process class responsible for starting the newly process.
System.Diagnostics.Process process1 = new System.Diagnostics.Process();
// Set the directory where the file resides
process1.StartInfo.WorkingDirectory = "C:\\VirtualCameraServiceSetup\\";
// Set the filename name of the file to be opened
process1.StartInfo.FileName = "VirtualCameraServiceProject.avc";
// Start the process
process1.Start();
}
catch (Exception ex)
{
eventLog1.WriteEntry("VirtualCameraService exception - " + ex.InnerException);
}
© Server Fault or respective owner