Multiple services of Topshelf enabled binary

Dan W.'s Avatar

Dan W.

09 Jan, 2017 01:16 PM


just trying to get started with OD. I have a question about Windows services. Currently we use the Topshelf API to register services. In particular to register multiple instances on a single machine.

If I understand your Docs correctly, this would not be supported as of this:

The only caveat is the value you specify in the Service Name parameter must match the Service Name specified in your Topshelf configuration code (in Program.cs) or the service will not start.

Am I correct here or am I missing something?

What would be the proposed way of deploying multiple instances through OD? I can see the following options for now

  • Don't use Topshelf and use different service names in OD deployment step (not a real option atm)
  • Write a custom deployment script to employ the Topshelf API
  1. 1 Posted by Dan W. on 09 Jan, 2017 01:31 PM

    Dan W.'s Avatar

    Or as a 3rd option maybe pass the service name as a parameter to the .exe so that SetServiceName of Topshelf receives the name as it starts.

  2. Support Staff 2 Posted by Daniel Fischer on 10 Jan, 2017 05:19 AM

    Daniel Fischer's Avatar

    Hi Dan,

    Thanks for getting in touch! I have had this question come through a couple of times and unfortunately I am not able to provide you with a very informative answer. From what I have seen it will require you write a custom deployment script for this to work on your end as you have suggested.

    Though I don’t think it directly answers your questions. The best resource I have found for using Octopus with Topshelf would be the following blog post:

    Have you tried your recent suggestion? If you have any success with the methods you have mentioned I would love to hear about it and potentially help future enquiries regarding Topshelf.

    Sorry for not being very helpful here.

    Best regards,

  3. 3 Posted by Dan W. on 13 Jan, 2017 09:17 AM

    Dan W.'s Avatar

    The link looks interesting. I will play around with my ideas and what is already there to see what works best. I hope to find the time to do so and probably share my conclusions on this topic.

    Thanks for your input!

  4. Support Staff 4 Posted by Daniel Fischer on 16 Jan, 2017 12:02 AM

    Daniel Fischer's Avatar

    Hi Dan,

    Thanks for getting back! We would love to hear what you come up with. :)

    Best regards,

  5. Paul Stovell closed this discussion on 16 Apr, 2017 02:11 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac