Cannot open service on computer

I construct one home window application and I likewise create one organization. I begin the service making use of coding in home window application, but I am gaining an error prefer cannot open up home window organization on computer "."

I have actually offered listed below code.

You watching: Cannot open service on computer

ServiceController controller = brand-new ServiceController("SeoMozScheduleService");if (controller.Status == ServiceControllerStatus.Stopped) controller.Start();If i best click on Application and also click on Run as Administrator than it functions fine for me...


*

*

To make this automatic eextremely time you open the application you need to add a manifest file to your solution, then update the requestedExecutionLevel node inside the file to look prefer this:

However, changing this setting will result in the device prompting you every time to run the application as administrator if UAC is permitted.


*

*

Go toc://Program Files/ApplicationFolder/.exeRight click .exe and go to Properties then go Compcapability Tab and also examine true to Run this Program as an administrator Level.


*

None of these solutions aided me, because it would certainly assist if I actually had actually ensured I had actually Administrator access on the targain computer first! I was taking ameans and offering back Administrator access to my major account utilizing my domain admin account. When I ran some ServiceController code that was checking if a service was running on a remote computer, under the doprimary admin account, all was fine. When I did it as my main account, that"s when it didn"t job-related - even once running Visual Studio as an Administrator. Turns out I had actually been trial and error without my major account in the local Admin team... d"oh!


I ran into this via a reserved job on a server--checking the "Run via greatest privileges" fixed it. (The organization account hregarding have actually admin rights of course for this to occupational.)


Frameoccupational version change in the app.conf to the variation which is set up on the mechanism solved the issue for me.

See more: What Is Perfmon Exe What Is It Or, How To Remove Perfmon


The application more than likely does not have to require Administrator permission. The Microsoft Management Console (MMC) (that consists of the Services snap-in) does not. The manifest for the MMC has:

It does not have actually level="requireAdministrator".

See c# - How carry out I create/modify a Manifest file? - Stack Overcirculation for instructions for adding a manifest to the task.

There are very many kind of posts around the principle of Leastern Privilege, consisting of the following.


Thanks for contributing an answer to Stack Overflow!

Please be certain to answer the question. Provide details and share your research!

But avoid

Asking for assist, clarification, or responding to various other answers.Making statements based upon opinion; back them up through references or individual experience.

See more: Free Download Hp Bluetooth Mouse X4000B Driver Download, Hp Bluetooth Mouse X4000B Driver Download

To learn more, check out our tips on composing excellent answers.


Blog post Your Answer Discard

By clicking “Article Your Answer”, you agree to our regards to service, privacy policy and cookie policy


Not the answer you're looking for? Browse other concerns tagged c# windows-solutions windows-applications or ask your very own question.


The Internet Application Project <…> is configured to use IIS. The Web server <…> can not be uncovered.
Cannot open Servicename business on computer '.'. Error on Starting Windows Service programatically utilizing c#
Windows, Start service System.InvalidOperationException: Cannot begin service on computer system '.' Access in Denied(Running as Admin)
website style / logo design © 2021 Stack Exreadjust Inc; user contributions licensed under cc by-sa. rev2021.4.1.38970


Your privacy

By clicking “Accept all cookies”, you agree Stack Exadjust deserve to save cookies on your device and also disclose information in accordance via our Cookie Policy.