lixiaojun
2022-08-24 9bae75037a9cdeb5d01bb3cbdf2386d2490673b8
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.SHYS");
    x.SetServiceName("IStation.Core.DataProvider.SHYS");
    x.EnableServiceRecovery(r => r.RestartService(TimeSpan.FromSeconds(120)));
    x.StartAutomatically();
});