C
carson
I have written two windows services:
- service A does some crunching of local data files and uploads them to
a central processing computer via http.
- service B monitors a manifest file on a webserver to see if service A
needs to be updated.
What service B does if it sees their is an update for service A is to
download a new copy of the service A executable, stop service A,
replace the executable with the new copy, and start service B back up.
Everything works fine until that very last step. I can programatically
stop and start the service just fine, if the service A executable was
placed their manually. If service B downloads and replaces the service
A executable, it can't then restart service A. When starting service A
it dies with
System.InvalidOperationException: Cannot start service Service A on
computer '.'. ---> System.ComponentModel.Win32Exception: Access is
denied
--- End of inner exception stack trace ---
at System.ServiceProcess.ServiceController.Start(String[] args)
at System.ServiceProcess.ServiceController.Start()
at namespace.ServiceB.t_update_Elapsed(Object sender,
ElapsedEventArgs e)
I am assuming this is just a permissions issue somwhere. Service A and
Service B are both installed with ServiceProcessInstaller.Account =
ServiceAccount.LocalSystem and Username and Password = null;
Any thoughts? Thanks in advance for your help, i'm a general newb at
windows application development.
- service A does some crunching of local data files and uploads them to
a central processing computer via http.
- service B monitors a manifest file on a webserver to see if service A
needs to be updated.
What service B does if it sees their is an update for service A is to
download a new copy of the service A executable, stop service A,
replace the executable with the new copy, and start service B back up.
Everything works fine until that very last step. I can programatically
stop and start the service just fine, if the service A executable was
placed their manually. If service B downloads and replaces the service
A executable, it can't then restart service A. When starting service A
it dies with
System.InvalidOperationException: Cannot start service Service A on
computer '.'. ---> System.ComponentModel.Win32Exception: Access is
denied
--- End of inner exception stack trace ---
at System.ServiceProcess.ServiceController.Start(String[] args)
at System.ServiceProcess.ServiceController.Start()
at namespace.ServiceB.t_update_Elapsed(Object sender,
ElapsedEventArgs e)
I am assuming this is just a permissions issue somwhere. Service A and
Service B are both installed with ServiceProcessInstaller.Account =
ServiceAccount.LocalSystem and Username and Password = null;
Any thoughts? Thanks in advance for your help, i'm a general newb at
windows application development.