Installed Win service does not appear in Service Manager

I have a windows service created in C #.

This is relatively simple compared to some of the others I've worked on.

I built an installation project to install it for some testing.

I added the main output from the service project, and all the dependencies were added correctly.

I went to View> User Actions and added my primary output for installation, commit, rollback and uninstall.

The project is built, and I right-clicked on the project and clicked the Install button.

Installation returned successfully, I can view the service on the control panel in the "Add or Remove Programs" section, but when I logged in to Service Manager ... nothing ...

Can someone provide any information or anything else that could lead to the fact that a successfully installed service will NOT be displayed in the service manager.

+3
source share
4 answers

, , , . , System.Configuration.Install.Installer, [RunInstaller (true)]. System.ServiceProcess.ServiceInstaller System.ServiceProcess.ServiceProcessInstaller, Installers. MSDN ServiceInstaller ServiceProcessInstaller , , , .

+4

, < Display name.

"sc query <service_name>", , ​​ Windows. , "sc query state= all >c:\ServicesList.txt" , ServicesList.txt C: \.

, HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services

+1

In my case, the solution to the problem was simple, I forgot to add the 'Public' access modifier to the class. After adding an access modifier, the service now appears in the list of services.

0
source

Source: https://habr.com/ru/post/1794533/


All Articles