System error 5 Access is denied when starting a .NET service

前端 未结 10 1828
离开以前
离开以前 2020-12-03 02:32

When I try to start a service I created in Visual Studio I receive the following error:

System error 5 has occurred.

Access is denied.

I a

10条回答
  •  囚心锁ツ
    2020-12-03 03:08

    The Local Services account doesn't seem to be privileged to control a service. So, in the service's LogOn Property, change the account type to Local System and allow service to interact with desktop.

    Also, make sure that, you install the service using instalutil, as an administrator.

    Lastly, when you want to run a service from the command prompt using the "net start [service name]" command, you have to run the command prompt as an administrator.

提交回复
热议问题