Service not showing in Services.msc but shows in taskmgr under services tab

4,728 views
Skip to first unread message

Scott Danks

unread,
Feb 10, 2014, 5:02:30 PM2/10/14
to topshelf...@googlegroups.com
I built a service that works well.  I started it and it is running.  But when I go to services.msc, it does not show up.  So I went to taskmgr and found the running process and clicked go to services and it shows the service running under the taskmgr services tab.  Did I miss some configuration somewhere?  I did notice that under the Group name it shows N/A enstead of the LocalService.  Thanks.

Kijana Woodard

unread,
Feb 10, 2014, 5:59:22 PM2/10/14
to topshelf...@googlegroups.com
In Hostfactory.Run, did you set

                x.SetServiceName("Foo");
                x.SetDisplayName("Foo Service");
                x.SetDescription("This is the Foo Service. It is FooBar.");


On Mon, Feb 10, 2014 at 4:02 PM, Scott Danks <sdank...@gmail.com> wrote:
I built a service that works well.  I started it and it is running.  But when I go to services.msc, it does not show up.  So I went to taskmgr and found the running process and clicked go to services and it shows the service running under the taskmgr services tab.  Did I miss some configuration somewhere?  I did notice that under the Group name it shows N/A enstead of the LocalService.  Thanks.

--
You received this message because you are subscribed to the Google Groups "topshelf-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topshelf-discu...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Scott Danks

unread,
Feb 10, 2014, 6:32:51 PM2/10/14
to topshelf...@googlegroups.com
I followed an example that updates a textfile every 10 seconds.  It is working.  But here is the code:
 HostFactory.Run(Sub(configurator)
                            configurator.Service(Of TimedNotifier)(Sub(service)
                                                                       service.ConstructUsing(Function(factory)
                                                                                                  Return New TimedNotifier
                                                                                              End Function)

                                                                       service.WhenStarted(Function(notifier, hostControl) As Boolean
                                                                                               Return notifier.Start(hostControl)
                                                                                           End Function)

                                                                       service.WhenStopped(Function(notifier, hostControl) As Boolean
                                                                                               Return notifier.Stop(hostControl)
                                                                                           End Function)
                                                                   End Sub)

                            configurator.RunAsLocalSystem()
                            configurator.SetDisplayName("Sample Service: Timed Notifier")
                            configurator.SetDescription("This sample service will notify you of the " & _
                              "current time every 10 seconds.")
                            configurator.SetServiceName("TimedNotifier")
                        End Sub)


I see TimedNotifier in the taskmgr but not in the services.msc  Dont know if it had to do with RunAsLocalSystem or not.  Maybe I cant see services because I am logged in as a admin but not the local admin?

Dru Sellers

unread,
Feb 10, 2014, 6:57:47 PM2/10/14
to topshelf...@googlegroups.com
How are you running the service?

Sent from Mailbox for iPhone


--

Kijana Woodard

unread,
Feb 10, 2014, 9:31:16 PM2/10/14
to topshelf...@googlegroups.com
Just to eliminate the easy stuff, did you install your service [eg run "TimedNotifier.exe install" at the command line]?

And you don't see "Sample Service: Timed Notifier" in services.msc either?



On Mon, Feb 10, 2014 at 5:32 PM, Scott Danks <sdank...@gmail.com> wrote:

--

Scott Danks

unread,
Feb 11, 2014, 11:23:21 AM2/11/14
to topshelf...@googlegroups.com
Ok.  That was it.  It looks like if you are using the services.msc it shows up as what you named the program in the SetDisplayName, but if you use the Taskmgr it shows up on the service tab as what you named the program using SetServiceName.  Obviously I need to just set them the same.  But problem solved.  Thanks for the direction.

Scott Danks

unread,
Feb 11, 2014, 11:25:18 AM2/11/14
to topshelf...@googlegroups.com
Thanks for the post Dru.  It turns out that the two service display programs services.msc and taskmgr both show the services as different names.  See the post I made to Kijana below.  I think the solution is to just set the name the same for both SetDisplayName and SetServiceName.

Thanks,
Scott

Reply all
Reply to author
Forward
0 new messages