ConfigurationManager v.s. WebConfigurationManager
Web application should use WebConfigurationManager whereas winform application should use ConfigurationManager.
- The WebConfigurationManager class has a GetWebApplicationSection method that the ConfigurationManager class does not have
- The OpenMappedExeConfiguration method of the ConfigurationManager is replaced with the OpenMappedWebConfiguration method of the WebConfigurationManager
- The OpenExeConfiguration method of the ConfigurationManager is replaced with the OpenWebConfiguration method of the WebConfigurationManager
How to use it?
To be able to use WebConfigurationManager , you need to add System.Web reference and use it like this System.Web.Configuration.WebConfigurationManager or adding appropriate using statement.
To be able to use ConfigurationManager, you need to add System.Configuration reference and use it like this System.Configuration.ConfigurationManager or adding appropriate using statement.