tangxu
2022-11-08 4b3a3910bc7f4c3bcd4db0634579c992c7171550
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// See https://aka.ms/new-console-template for more information
 
using IStation.TopShelf;
using Topshelf;
 
HostFactory.Run(x =>
{
    x.Service<Service>();
    x.RunAsLocalSystem();
    x.SetDescription("上海城投Core版数据提供程序");
    x.SetDisplayName("IStation.Core.DataProvider.SMI");
    x.SetServiceName("IStation.Core.DataProvider.SMI");
    x.EnableServiceRecovery(r => r.RestartService(TimeSpan.FromSeconds(120)));
    x.StartAutomatically();
});