0

I have the following in my web.config:

<configuration>
    <system.web>
        <httpRuntime executionTimeout="180"/>
    </system.web>
</configuration>

Is there a .NET built-in way to retrieve executionTimeout value? Perhaps via ConfigurationManager set of objects? I don't see anything obvious.

AngryHacker
  • 59,598
  • 102
  • 325
  • 594

1 Answers1

5

Any section can be retrieved from using GetSection

var httpRuntimeSection = ConfigurationManager.GetSection("system.web/httpRuntime") as 
HttpRuntimeSection;

//httpRuntimeSection.ExecutionTimeout

ExecutionTimeout

In Web app we could use WebConfigurationManager that also has similar API - GetSection

ConfigurationManager vs. WebConfigurationManager

Community
  • 1
  • 1
amit_g
  • 30,880
  • 8
  • 61
  • 118