G
Guest
HI there,
My machine.config contains the following setting.
<httpRuntime
executionTimeout="90"
maxRequestLength="4096"
useFullyQualifiedRedirectUrl="false"
minFreeThreads="8"
minLocalRequestFreeThreads="4"
appRequestQueueLimit="100"
/>
I want to extract the value for max request length.
I started using 'ConfigurationSettings.GetConfig
("system.web/httpRuntime")' which I thought should return
what I am after.
All code example I have seen use something along the lines
of '(NameValueCollection)ConfigurationSettings.GetConfig
(SectionName);
When I try to run 'NameValueCollection httpRun =
(NameValueCollection)ConfigurationSettings.GetConfig
("system.web/httpRuntime");'
I get an Invalid cast exception.
Running just 'ConfigurationSettings.GetConfig
("system.web/httpRuntime")' in the immediate window
returns the following:
ConfigurationSettings.GetConfig("system.web/httpRuntime")
{System.Web.Configuration.HttpRuntimeConfig}
System.Object:
{System.Web.Configuration.HttpRuntimeConfig}
DefaultExecutionTimeout: 90
DefaultMaxRequestLength: 4194304
DefaultMinFreeThreads: 8
DefaultMinLocalRequestFreeThreads: 4
DefaultAppRequestQueueLimit: 100
DefaultShutdownTimeout: 10
DefaultDelayNotificationTimeout: 5
_executionTimeout: 90
_maxRequestLength: 41943040
_useFullyQualifiedRedirectUrl: false
_minFreeThreads: 8
_minLocalRequestFreeThreads: 4
_appRequestQueueLimit: 100
_shutdownTimeout: 10
_delayNotificationTimeout: 5
ExecutionTimeout: 90
MaxRequestLength: 41943040
UseFullyQualifiedRedirectUrl: false
MinFreeThreads: 8
MinLocalRequestFreeThreads: 4
AppRequestQueueLimit: 100
ShutdownTimeout: 10
DelayNotificationTimeout: 5
So I tried to declare a variable of
type: 'System.Web.Configuration.HttpRuntimeConfig'
The compiler then throws an error saying
that 'System.Web.Configuration.HttpRuntimeConfig' its
access level.
May be I'm barking at the wrong tree and there is an
object somewhere that retruns the value I am after?
My machine.config contains the following setting.
<httpRuntime
executionTimeout="90"
maxRequestLength="4096"
useFullyQualifiedRedirectUrl="false"
minFreeThreads="8"
minLocalRequestFreeThreads="4"
appRequestQueueLimit="100"
/>
I want to extract the value for max request length.
I started using 'ConfigurationSettings.GetConfig
("system.web/httpRuntime")' which I thought should return
what I am after.
All code example I have seen use something along the lines
of '(NameValueCollection)ConfigurationSettings.GetConfig
(SectionName);
When I try to run 'NameValueCollection httpRun =
(NameValueCollection)ConfigurationSettings.GetConfig
("system.web/httpRuntime");'
I get an Invalid cast exception.
Running just 'ConfigurationSettings.GetConfig
("system.web/httpRuntime")' in the immediate window
returns the following:
ConfigurationSettings.GetConfig("system.web/httpRuntime")
{System.Web.Configuration.HttpRuntimeConfig}
System.Object:
{System.Web.Configuration.HttpRuntimeConfig}
DefaultExecutionTimeout: 90
DefaultMaxRequestLength: 4194304
DefaultMinFreeThreads: 8
DefaultMinLocalRequestFreeThreads: 4
DefaultAppRequestQueueLimit: 100
DefaultShutdownTimeout: 10
DefaultDelayNotificationTimeout: 5
_executionTimeout: 90
_maxRequestLength: 41943040
_useFullyQualifiedRedirectUrl: false
_minFreeThreads: 8
_minLocalRequestFreeThreads: 4
_appRequestQueueLimit: 100
_shutdownTimeout: 10
_delayNotificationTimeout: 5
ExecutionTimeout: 90
MaxRequestLength: 41943040
UseFullyQualifiedRedirectUrl: false
MinFreeThreads: 8
MinLocalRequestFreeThreads: 4
AppRequestQueueLimit: 100
ShutdownTimeout: 10
DelayNotificationTimeout: 5
So I tried to declare a variable of
type: 'System.Web.Configuration.HttpRuntimeConfig'
The compiler then throws an error saying
that 'System.Web.Configuration.HttpRuntimeConfig' its
access level.
May be I'm barking at the wrong tree and there is an
object somewhere that retruns the value I am after?