System.ComponentModel.Win32Exception: Access is denied Error

前端 未结 2 1794
我在风中等你
我在风中等你 2020-12-09 04:39

I am using C# code to start and stop the window serves but I am getting this error.

System.ComponentModel.Win32Exception: Access is denied

相关标签:
2条回答
  • 2020-12-09 05:11

    Run your VS in administrator mode and load your project.Open developer VS cmd in administrator mode.Give proper username with computer domain name like domainname\username.Hope it will work.

    0 讨论(0)
  • 2020-12-09 05:36

    Make sure your application pool identity account on your server has permissions to start that service. It works on your ASP.NET Development Server because it runs under your user account (admin) In a default IIS configuration, this account is Network service or ApplicationPoolIdentity (depending on IIS version) and usually cannot manage services.

    So, change the pool account in IIS Manager (Application Pools/NameOfYourYourPool/Advanced Settings). You can use a built-in account or use one of your domain.

    apppool

    0 讨论(0)
提交回复
热议问题