Topshelf - starting threads based on custom parameters
问题 I've made a topshelf webservice that uses custom parameter: string department = null; // *********************Below is a TopShelf HostFactory.Run(hostConfigurator => { //Define new parameter hostConfigurator.ApplyCommandLine(); //apply it hostConfigurator.AddCommandLineDefinition("department", f => { department = f; }); Helpers.LogFile("xxx", "Got department:"+department); hostConfigurator.Service<MyService>(serviceConfigurator => { //what service we are using serviceConfigurator