Hi All,
I'm trying to execute an action (publish a message to RMQ) before the service stops in a BeforeStoppingService(Action<HostStopContext>) handler.
I wanted to use the BeforeStoppingService method because when I try to execute the action in the Stop() of ServiceControl I get a System.Threading.Tasks.TaskCanceledException. (at least, when using ctrl+c to quit from the command line), but now I don't know how to access the instance of the service there.
Any ideas on how to achieve this?
Thanks!
Wiebe