Credentials when Installing Windows Service

前端 未结 4 1308
野性不改
野性不改 2021-02-01 00:34

I am attempting to install a C# windows service project using a VisualStudio.Net deployment project.

To run the deployment project I right-click and select \"install\"

4条回答
  •  感情败类
    2021-02-01 01:21

    Add this code to your private void InitializeComponent() method in projectInstaller.Designer.cs file in your windows service project.

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

    if the definition of you process installer is:

    private System.ServiceProcess.ServiceProcessInstaller serviceProcessInstaller1;
    

提交回复
热议问题