SetServiceName is limited to 25 chars

29 views
Skip to first unread message

Stuart O'Reilly

unread,
Dec 28, 2013, 1:37:55 AM12/28/13
to topshelf...@googlegroups.com
Hello All,
I have been chasing a problem which i have narrowed down to be caused by the length of the ServiceName. Basically, when i would try to start my service in the VS2010 debugger, the service would start and die immediately.
I've narrowed it down to the following line

x.SetServiceName("DinRelayControlServiceName");

if i changed the line to

x.SetServiceName("DinRelayControlServiceNam");

(removed one character from the service name) it all works as expected

My initialisation code looks like

            HostFactory.Run(x =>
                    {
                        x.Service<DoDinRelay>(s =>
                    {
                        s.ConstructUsing(name => new DoDinRelay());
                        s.WhenStarted(tc => tc.Start());
                        s.WhenStopped(tc => tc.Stop());
                    });
                        x.RunAsLocalSystem();
                        x.SetDescription("DinRelayControl using Topshelf");
                        x.SetDisplayName("DinRelayControl");
                        x.SetServiceName("DinRelayControlServiceName");
                    });

This only occurs when i am debugging it in Visual Studio 2010. If I install it as a service, the service name length doesn't affect the service operation
I am using 
Topshelf v3.0.105.0,
and
.NET Framework v4.0.30319.1008

Is this a bug?
Thanks
Stuart

Dru Sellers

unread,
Dec 30, 2013, 12:52:48 PM12/30/13
to topshelf...@googlegroups.com
can you pass along the stack trace?


--
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.

Reply all
Reply to author
Forward
0 new messages