c# - System.ComponentModel.Win32Exception: Access is denied Error

c# – System.ComponentModel.Win32Exception: Access is denied Error

c# – System.ComponentModel.Win32Exception: Access is denied Error

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

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 domainnameusername.Hope it will work.

c# – System.ComponentModel.Win32Exception: Access is denied Error

Related posts on Access Error :

Leave a Reply

Your email address will not be published.