private static void LoadConfigDataFromWebConfig(DeleporterConfigurationSection config) { // Get rest of settings out of web.config var webConfigPath = Path.Combine(FullyQualifiedPathToWebApp, "web.config"); var configFileMap = new ExeConfigurationFileMap { ExeConfigFilename = webConfigPath }; _webConfig = ConfigurationManager.OpenMappedExeConfiguration(configFileMap, ConfigurationUserLevel.None); try { config = (DeleporterConfigurationSection)_webConfig.GetSection("deleporter"); } catch (Exception exception) { Console.WriteLine(exception); } if (config != null) { RemotingPort = config.RemotingPort; Host = config.Host; ServiceName = config.ServiceName; WebHostPort = config.WebHostPort; if (config.LoggingEnabled) { LoggingEnabled = config.LoggingEnabled; } } else { RemotingPort = DefaultRemotingPort; Host = DefaultHost; ServiceName = DefaultServiceName; WebHostPort = DefaultWebHostPort; } }
private static void LogPortChanges(int newWebHostPort, int newRemotingPort, DeleporterConfigurationSection configSection) { if (configSection.WebHostPort != newWebHostPort) { LoggerClient.Log("Changing WebHostPort in web.config from {0} to {1}", configSection.WebHostPort, newWebHostPort); } if (configSection.RemotingPort != newRemotingPort) { LoggerClient.Log("Changing RemotingPort in web.config from {0} to {1}", configSection.WebHostPort, newWebHostPort); } }
private static void LogPortChanges(int newWebHostPort, int newRemotingPort, DeleporterConfigurationSection configSection) { if (configSection.WebHostPort != newWebHostPort) LoggerClient.Log("Changing WebHostPort in web.config from {0} to {1}", configSection.WebHostPort, newWebHostPort); if (configSection.RemotingPort != newRemotingPort) LoggerClient.Log("Changing RemotingPort in web.config from {0} to {1}", configSection.WebHostPort, newWebHostPort); }
private static void LoadConfigDataFromWebConfig(DeleporterConfigurationSection config) { // Get rest of settings out of web.config var webConfigPath = Path.Combine(FullyQualifiedPathToWebApp, "web.config"); var configFileMap = new ExeConfigurationFileMap { ExeConfigFilename = webConfigPath }; _webConfig = ConfigurationManager.OpenMappedExeConfiguration(configFileMap, ConfigurationUserLevel.None); try { config = (DeleporterConfigurationSection)_webConfig.GetSection("deleporter"); } catch (Exception exception) { Console.WriteLine(exception); } if (config != null) { RemotingPort = config.RemotingPort; Host = config.Host; ServiceName = config.ServiceName; WebHostPort = config.WebHostPort; if (config.LoggingEnabled) LoggingEnabled = config.LoggingEnabled; } else { RemotingPort = DefaultRemotingPort; Host = DefaultHost; ServiceName = DefaultServiceName; WebHostPort = DefaultWebHostPort; } }