简体   繁体   English

Windows以其他用户身份登录时启动服务失败?

[英]windows start service failure on logging as different user?

I've logged into the visual studio as a different user while debugging the project encountered with error as: 我以其他用户身份登录Visual Studio,同时调试遇到以下错误的项目:

"Windows service start failure" “ Windows服务启动失败”

But when I run with my own credentials working fine. 但是当我使用自己的凭据运行时,效果很好。 I've tried by giving admin permissions to the particular user on the service but the result is same as below. 我已经尝试通过向服务上的特定用户授予管理员权限,但是结果与以下相同。

Can anyone help me on this?. 谁可以帮我这个事?。

click here to see the issue 单击此处查看问题

Ensure your service has a ' ServiceProcessInstaller ' (right-click designer-surface of your service.cs and select 'Add Installer'), then change the account property for the service process installer to whatever suits your needs best (Network Service, Local System or Local Service). 确保您的服务具有“ ServiceProcessInstaller ”(在service.cs的designer-surface上单击鼠标右键,然后选择“ Add Installer”),然后将服务流程安装程序的account属性更改为最适合您的需求(网络服务,本地系统或本地服务)。 You may also need to specify the startup type of the service installer class. 您可能还需要指定服务安装程序类的启动类型。

To install it do the following steps: 要安装它,请执行以下步骤:

  1. Run Visual Studio Command Prompt as administrator. 以管理员身份运行Visual Studio命令提示符。
  2. Change the directory to the output directory of the service (where the executable file is located) - ' cd C:\\directory ' 将目录更改为服务的输出目录(可执行文件所在的位置)-' cd C:\\ directory '
  3. Perform the following command ' installutil service_name.exe ' 执行以下命令“ installutil service_name.exe

The service should then startup based on the startup type you specified. 然后,服务应根据您指定的启动类型启动。 You may need to start it manually. 您可能需要手动启动。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM