This question was asked elsewhere on SO , but there is no indication of how I get the HostControl instance as the message suggests. My main TopShelf program is as follows:
public static void Main() { HostFactory.Run(CreateHost); } private static void CreateHost(HostConfigurator x) { x.UseLog4Net(); x.Service<EventBroker>(s => { s.ConstructUsing(name => new EventBroker()); s.WhenStarted(tc => tc.Start()); s.WhenStopped(tc => tc.Stop()); }); x.StartAutomatically(); x.RunAsNetworkService(); }
Any suggestions?
Brent arias
source share