Error 5 : Access Denied when starting windows service

前端 未结 30 2426
滥情空心
滥情空心 2020-12-04 18:49

I\'m getting this error when I try to start a windows service I\'ve created in C#:

\"alt

My Code

30条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-04 19:21

    Use LocalSystem Account instead of LocalService Account in Service Installer.

    You can do this either from doing below change in design view of your service installer:
    Properties of Service Process Installer -> Set Account to LocalSystem.

    or by doing below change in in designer.cs file of your service installer:

    this.serviceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalSystem;
    

提交回复
热议问题