Difference between revisions of "Accessing Configuration Settings"
From Logic Wiki
m |
m (1 revision imported) |
(No difference)
| |
Latest revision as of 14:27, 9 May 2016
Use the ConfigurationManager from System.Configuration
var server = ConfigurationManager.AppSettings["FileServerName];
var modulesSection = ConfigurationManager.GetSection("system.web/httpModules") as HttpModulesSection;
var installedModules = modulesSection.Modules.Count;
Configuration Hierarchy
Each application inherits settings from higher level config files
- Machine.config
- Machine web.config
- Parent's web.config
- your web.config
Check : Web Config Transform