c# - Topshelf service not starting Access is denied -


i built topshelf sample application, (version 4.0.1) 1 timedevents write console. install , run ok admin. when installing networkservice (trying run fewer privileges better security practices) got error:

[success] name stuff, [success] description sample topshelf host, [success] servicename stuff topshelf v4.0.0.0, .net framework v4.0.30319.42000 topshelf.hosts.starthost error: 0 : service failed start., system.invalidoperationexception: cannot start service stuff on computer '.'. ---> system.componentmodel.win32exception: access denied --- end of inner exception stack trace --- @ system.serviceprocess.servicecontroller.start(string[] args) @ system.serviceprocess.servicecontroller.start() @ topshelf.runtime.windows.windowshostenvironment.startservice(string servicename, timespan starttimeout) @ topshelf.hosts.starthost.run()

in case, there no input or output file, access permissions other files should not problem.

turns out in case, when there no file permissions input/output take care of, executable needs appropriate permissions set. setting needs "read+execute".

this problem variation of answer here: cannot start windows service in networkservice account

following steps there, , setting permissions on executables (in case bin/debug folder) , topshelf service runs fine.

[success] name stuff, [success] description sample topshelf host, [success] servicename stuff topshelf v4.0.0.0, .net framework v4.0.30319.42000 stuff service started.

so, when using topshelf, still have make sure else set appropriately service run.

i recommend approach on registry editing, or running services localsystem have seen recommended in other answers similar permissions issues windows services.


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -