2011-06-27 26 views
2

我遇到擱置Topshelf服務的問題,該服務在應該執行此操作時不會啓動:即使擱置文件夾發生更改,並且Topshelf注意到此情況,服務也不會啓動。沒有錯誤消息(實際上根本沒有日誌消息),我真的不知道從哪裏開始尋找問題。爲什麼我的Topshelf服務不啓動?

這是我有:

  • 我在Topshelf注意到該文件夾​​C:\Topshelf.Host\Services\MyService\在變化日誌已經驗證。

  • 我已驗證Topshelf貨架文件夾中的文件名是MyAssembly.dllMyAssembly.configMyAssemblyMyService是相同的,甚至匹配的情況下。

  • 我在配置文件中的以下內容:

    <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() 
         { 
          ... 
         } 
        } 
    } 
    
+0

加入郵件列表http://groups.google.com/group/topshelf-discuss或發佈錯誤https://github.com/Topshelf/Topshelf/issues。 – Travis

+0

感謝您無意中指出我錯過了標記! – Pakman

回答

2

事實證明一切,我包括在問題被確實正確的設置,但我在配置文件的其他地方,加載我的服務時給Topsheft麻煩的拼寫錯誤。當我糾正這些問題時,一切都按預期工作。

我關閉了這個問題,因爲問題並不在這裏。

相關問題