Here is the MSDN Page listing all the values and their default value.
The following code will open the httpRuntime programccly
Configuration config = WebConfigurationManager.OpenWebConfiguration("~"); object o = config.GetSection("system.web/httpRuntime"); HttpRuntimeSection section = o as HttpRuntimeSection;
This code was found here.
And in VB
Dim config As Configuration = WebConfigurationManager.OpenWebConfiguration("~") Dim o As Object = config.GetSection("system.web/httpRuntime") Dim section As HttpRuntimeSection = TryCast(o, HttpRuntimeSection)
Make sure you use / Import the following namespaces.
System.Configuration; System.Web.Configuration;
Edit based on comment.
When calling WebConfigurationManager.OpenWebConfiguration From MSDN
path Type: System.String The virtual path to the configuration file. If null, the root Web.config file opens.
Even if you do not have the httpRuntime defined in your web.config, this is the root of the Web.config and this is returned. I checked this with and without httpRuntime definition.
David Basarab May 18 '10 at 16:03 2010-05-18 16:03
source share