Showing posts with label PrintAPIHeartTest. Show all posts
Showing posts with label PrintAPIHeartTest. Show all posts

Monday 14 December 2015

How to change or set service name in window services

In program.cs you can change or set  the service name.

  static void Main()
        {
                        ServiceBase[] ServicesToRun;
            SelfHostService _selfHostService = new SelfHostService();
//Below you can set the service name. In my case service name is PrintAPIHeartTest.
            _selfHostService.ServiceName = "PrintAPIHeartTest";
            ServicesToRun = new ServiceBase[]
            {
                _selfHostService
            };
            ServiceBase.Run(ServicesToRun);

        }