2
我遇到擱置Topshelf服務的問題,該服務在應該執行此操作時不會啓動:即使擱置文件夾發生更改,並且Topshelf注意到此情況,服務也不會啓動。沒有錯誤消息(實際上根本沒有日誌消息),我真的不知道從哪裏開始尋找問題。爲什麼我的Topshelf服務不啓動?
這是我有:
我在Topshelf注意到該文件夾
C:\Topshelf.Host\Services\MyService\
在變化日誌已經驗證。我已驗證Topshelf貨架文件夾中的文件名是
MyAssembly.dll
和MyAssembly.config
。MyAssembly
和MyService
是相同的,甚至匹配的情況下。我在配置文件中的以下內容:
<configSections> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /> <section name="ShelfConfiguration" type="Topshelf.Shelving.ShelfConfiguration, TopShelf" /> </configSections> <ShelfConfiguration Bootstrapper="MyNamespace.MyBootstrapper, MyAssembly" /> ...
我在
MyAssembly.dll
以下類:namespace MyNamespace { public class MyBootstrapper : Bootstrapper<MyService> { public void InitializeHostedService(IServiceConfigurator<MyService> cfg) { cfg.HowToBuildService(name => new MyService()); cfg.WhenStarted(s => s.StartService()); cfg.WhenStopped(s => s.StopService()); } } public class MyService { public void StartService() { ... } public void StopService() { ... } } }
加入郵件列表http://groups.google.com/group/topshelf-discuss或發佈錯誤https://github.com/Topshelf/Topshelf/issues。 – Travis
感謝您無意中指出我錯過了 和 標記! –
Pakman