以下是HostFactory
使用New
方法创建和声明服务的示例:http: //docs.topshelf-project.com/en/latest/configuration/config_api.html#simple-service
HostFactory.New(x =>
{
x.Service<MyService>();
});
// Service implements the ServiceControl methods directly and has a default constructor
class MyService : ServiceControl
{}
但我不知道如何立即启动此服务(如HostFactory.Run(...)
)?