(5): Access is denied.
A pretty clear error message.
The user/app requires elevated (admin) permissions to start a Windows service.
ERROR_ACCESS_DENIED =>
https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I'm running this code from maui app lat version + worker service NET core 6
ServiceController service = new ServiceController(servicName);
service.Start();
service.WaitForStatus(ServiceControllerStatus.Running);
And i got:
2022-09-13 10:57:12,636 [1] ERROR AutomationClient.Shared.Helpers.ServiceHelper - StartService
System.InvalidOperationException: Cannot open 'GS Automation Client Worker Service' service on computer '.'.
---> System.ComponentModel.Win32Exception (5): Access is denied.
--- End of inner exception stack trace ---
at System.ServiceProcess.ServiceController.GetServiceHandle(Int32 desiredAccess)
at System.ServiceProcess.ServiceController.Start(String[] args)
at System.ServiceProcess.ServiceController.Start()
at AutomationClient.Shared.Helpers.ServiceHelper.StartService(String servicName)
(5): Access is denied.
A pretty clear error message.
The user/app requires elevated (admin) permissions to start a Windows service.
ERROR_ACCESS_DENIED =>
https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-