I'm trying to run several similar services via ServiceBase.Run(ServiceBase[] )
but it's only running the first one. MSDN doesn't explicitly deny this; does this excerpt mean that they all must be different types? (the bold is by me, not MSDN)
Call this overload in the main() function of the service executable to load an array of associated services.
That is the intent. The idea here is that you can have a single executable create "multiple services" instead of just a single type of service.
When a service is registered with the SCM, it's expected that each service is unique. This would suggest (and I believe it's the case) that each element in your array must be a unique implementation of ServiceBase.
If you really are just trying to have multiple copies of the same service, I would rethink your design. Just have the service fire off multiple threads using the same method, and it will provide that same effect with a single service instance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With