/// <summary> /// Registers the executable for multiple services with the Service Control Manager (SCM). /// </summary> /// <param name="services">An array of System.ServiceProcess.ServiceBase instances to start. All services must extend System.SystemProcess.ServiceBase.</param> /// /// <exception cref="ArgumentException">An element in the array is null.</exception> /// <exception cref="ArgumentNullException">Null has been passed in.</exception> public void Run(ServiceBase[] services) { if (services == null) { throw new ArgumentNullException("Cannot run the services because the array of services supplied is null."); } if (services.Any(s => s == null)) { throw new ArgumentException("Cannot run the services because the array contains a null element."); } ServiceBase.Run(services); }