Topshelf service not starting on windows server 2012.

1,542 views
Skip to first unread message

Heinrich Kollner

unread,
May 26, 2014, 11:33:13 AM5/26/14
to topshelf...@googlegroups.com
Hi Guys,

I am having an issue with my topshelf service that installs and runs 100% on all windows servers except for windows server 2012.
I have installed and run this service on a Windows server 2008R, windows 7 and windows 8 without problems.
First time installing it on a windows server 2012. It installs fine without problem. When I go into Local services and start the service I am immediately presented with the following error: Error 1053: Did not respond in a timely fashion.

I have build in extensive logging to find exactly where the service fails and it does not seems to even hit the Start() method on server 2012.

I have tried everything up until now with no success.

Here's my start up method that works on all other windows server editions except for 2012.

static void Main()
        {
            try
            {

                HostFactory.Run(x =>
                {
                    x.Service<ApplicationStartup>(s =>
                    {
                        s.ConstructUsing(name => new ApplicationStartup());
                        s.WhenStarted(tc => tc.Start());
                        s.WhenStopped(tc => tc.Stop());
                    });
                    x.RunAsLocalSystem();
                    x.StartManually();
                    x.SetDescription("REDDOTT SOLUTION ENGINE");
                    x.SetDisplayName("REDDOTT SOLUTION ENGINE");
                    x.SetServiceName("REDDOTTSOLUTIONENGINE");
                });
            }
            catch (Exception ex)
            {
                Logger.ErrorException("Main Registered an Exception.", ex);
                throw;
            }
        }


You help is greatly appreciated.

Kijana Woodard

unread,
May 27, 2014, 8:45:29 AM5/27/14
to topshelf...@googlegroups.com

My guess is it's something else, that is environmental, that's failing within your tc.Start call. I've run to shelf on 2012 many times, without issue.

Easy easy to find out: comment out all the code from Start and try again.

--
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/d/optout.

Chris Patterson

unread,
May 27, 2014, 2:17:20 PM5/27/14
to topshelf...@googlegroups.com
Also, the factory method for your service should also include any container setup or other service-specific concerns. Your application should do nothing more than configure NLog/Log4Net before calling the HostFactory.Run() method.
Reply all
Reply to author
Forward
0 new messages