.NET Windows Services stopping order when the system shutdown
问题 I'm creating a windows service that is supposed to send a request to a RESTFull service that is located on the same machine when the system shutdown. I want to make sure that my service OnStop() event will fire before the IIS service is stopped. Is there a way that I can control the order of services closure? 回答1: Microsoft documents this: To set the shutdown order of services manually, create a multistring registry value that contains the service names in the order in which they should be