我有幾個控制檯應用程序作爲服務在頂棚下運行安裝,如果我手動安裝和運行,他們工作正常。但是,即使啓動類型設置爲自動,也不會自動啓動。自動服務不啓動
這些應用被配置如下:
HostFactory.Run(x =>
{
x.Service<MyApp>(s =>
{
s.ConstructUsing(name => container.Resolve<MyApp>());
s.WhenStarted(tc => tc.Start());
s.WhenStopped(tc =>
{
tc.Stop();
container.Dispose();
});
});
x.RunAsLocalSystem();
x.StartAutomatically();
x.EnableServiceRecovery(rc => rc.RestartService(5));
});
這些應用2008贏R2下運行,並且它們使用如管理員執行批處理文件進行安裝。該批處理文件包括以下內容:
app.exe install --sudo
app.exe start
執行批處理文件後,服務按預期方式運行。但是,如果我重新啓動他們仍然停止
事件日誌返回每個服務在同一對的事件:
Event 7000: The service failed to start due to the following error: The service did not respond to the start or control request in a timely fashion.
Event 7009: A timeout was reached (30000 milliseconds) while waiting for the service to connect.
到啓動應用程序後重新啓動是從提升的命令提示運行app.exe start
的唯一方法。
任何想法?
你剛剛救了我100年的信息垃圾挖掘:) – alerya