我通过服务名称为参数列表,但是当我看在安装方面是不是有:C#InstallUtil/ManagedInstallerClass:为什么键值对未传入安装程序上下文参数集合中?
args = new[] { Assembly.GetExecutingAssembly().Location, "/ServiceName=WinService1" };
ManagedInstallerClass.InstallHelper(args);
为什么键值对不能传递到安装方面?
public override void Install(IDictionary stateSaver)
{
foreach (var param in Context.Parameters)
{
// ServiceName is not available in the Parameters collection
}
}
可能是因为他们通过* stateSaver *。 – 2011-05-27 12:59:10