2011-02-21 2 views
0

が含まれている私はここで一番上の棚を使用して、ウィンドウのサービスとしてコンソールアプリケーションをホストしようとしているコードは次のとおりです。一番上の棚は、複数の要素

RunConfiguration cfg = RunnerConfigurator.New(x => 
{ 
    x.ConfigureService<Certegy>(s => 
    { 
     s.Named("certegy"); 
     s.HowToBuildService(name => new Certegy()); 
     s.WhenStarted(tc => tc.Start()); 
     s.WhenStopped(tc => tc.Stop()); 
    }); 
    if (string.IsNullOrEmpty(args[1])) 
    { 
     x.RunAsLocalSystem(); 
     } 
    else 
    { 
     x.RunAs(args[1], args[2]); 
    } 

    x.SetDescription("Certegy host to get the messages from the queue"); 
    x.SetDisplayName("Certegy Interface"); 
    x.SetServiceName("Certegy Interface"); 
}); 

    Runner.Host(cfg, args); 

私が実行しているコマンドラインからのように:

ExeName install username password 

は私が最後の行でエラー{"Sequence contains more than one element"}を取得しています

Runner.Host(cfg, args); 

誰か助けてくれますか?

答えて

0

Topshelfのどのバージョンをお使いですか?

この機能を追加したChrisの最新開発コードをhttps://github.com/phatboyg/Topshelf/tree/developに持っていれば、コマンドラインからのユーザー名とパスワードはしばらく時間がかかりませんでした。 app.configから当面読み込むコード。

+0

あなたの入力のためのトラビスありがとう! – atul

+0

うれしかったのでうれしいです。 – Travis

関連する問題