managedinstallerclass

C# InstallUtil/ManagedInstallerClass: Why are key value pairs not pass into the installers context parameters collection?

旧街凉风 提交于 2019-12-08 11:52:10
问题 I pass the service name into the argument list, but when I look in the installers context it is not there: args = new[] { Assembly.GetExecutingAssembly().Location, "/ServiceName=WinService1" }; ManagedInstallerClass.InstallHelper(args); Why are key value pairs not pass into the installers context? public override void Install(IDictionary stateSaver) { foreach (var param in Context.Parameters) { // ServiceName is not available in the Parameters collection } } 回答1: This is quite old thread, but