
如圖,我是用的是.net 5框架,我以為可能是我的讀取組態檔獲取其它之類的問題,所以我注釋了業務代碼,但是發現還是不能運行。
大佬們幫忙看看,以下為代碼,
static void Main(string[] args)
{
//Console.WriteLine(ConfigHelper.GetSectionValue("Connections:OARW"));
string name ="atest"/* ConfigHelper.GetSectionValue("TopShelf:Name") ??$"{Guid.NewGuid():N}"*/;
HostFactory.Run(x =>
{
x.Service<OneOnOneTimerService>(s =>
{
s.ConstructUsing(x => new OneOnOneTimerService());
s.WhenStarted(x => x.Start());
s.WhenStopped(x => x.Stop());
});
x.StartAutomatically();
x.RunAsLocalSystem();
x.RunAsLocalService();
x.SetDisplayName(/*ConfigHelper.GetSectionValue("TopShelf:Display") ??*/ name);
x.SetDescription(/*ConfigHelper.GetSectionValue("TopShelf:Description") ?? */name);
x.SetServiceName(name);
});
Console.ReadKey();
}
public void Start()
{
//_quartz.PauseJob();
}
public void Stop()
{
//_quartz.ResumeJob();
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/285240.html
標籤:C#
上一篇:為什么雙緩沖必須要用e.graphics,而不能用this.creatheGraphics()
下一篇:動態加載WebService問題
