private void InitializeConfiguration(ConfigurationPackage package) { string settingsDestinationPath = this.GetLocalPathForApplication(package.Path) + NtServicePath + "Settings.xml"; NtServiceConfigurationUtility.CreateConfigurationForNtService(package, settingsDestinationPath); if (package.Settings != null && package.Settings.Sections.Contains(settingsSectionName)) { this.ModifySettings(package.Settings.Sections[settingsSectionName]); } }
private void InitializeConfiguration(ConfigurationPackage package) { string settingsDestinationPath = this.GetLocalPathForApplication(package.Path) + NtServicePath + "Settings.xml"; try { NtServiceConfigurationUtility.CreateConfigurationForNtService(package, settingsDestinationPath, this.fabricClient, this.Context); if (package.Settings != null && package.Settings.Sections.Contains(settingsSectionName)) { this.ModifySettings(package.Settings.Sections[settingsSectionName]); } string healthMessage = "Settings validation was successful."; HealthManagerHelper.PostServiceHealthReport(this.fabricClient, this.Context, SettingsValidationProperty, healthMessage, HealthState.Ok, 1); } catch (Exception ex) { ServiceEventSource.Current.ErrorMessage("InitializeConfiguration failed with exception: {0}", ex); this.Partition.ReportFault(FaultType.Permanent); } }