我正在尝试使用顶层架子将控制台应用程序作为窗口服务托管,代码如下:
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);
有人可以帮忙吗?