ningshuxia
2022-08-12 2bfffddaef4af6bcb03a7f90691f5434e2e47024
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.DataDocking.MiddleLib");
    x.SetServiceName("IStation.Core.DataDocking.MiddleLib");
    x.EnableServiceRecovery(r => r.RestartService(TimeSpan.FromSeconds(120)));
    x.StartAutomatically();
});