/// <summary> /// Stops the specified service app. /// </summary> /// <param name="appName">Name of the application.</param> /// <param name="dao">The DAO.</param> /// <param name="isExiting">Set to <c>true</c> if the service is in the middle of exiting.</param> /// <exception cref="System.IndexOutOfRangeException">The app name could not be found.</exception> public void StopServiceApp(string appName, IServiceAppDao dao, bool isExiting) { ServiceAppProcess process = this.ServiceAppProcesses[appName]; if (process == null) { var e = new IndexOutOfRangeException(string.Format("appName '{0}' could not be found to stop.", appName)); this._log.Error("Error in StopServiceApp", e); } else { process.Stop(isExiting); _schedulingService.RemoveJob(appName); dao.RecordServiceAppStop(appName); } }