protected override void PostDeserialize()
{
// Perf optimization. If the configuration is coming from machine.config
// It is safe and we don't need to check for permissions.
if (EvaluationContext.IsMachineLevel)
return;
PropertyInformation[] protectedProperties = {
ElementInformation.Properties[ConfigurationStrings.MaximumResponseHeadersLength],
ElementInformation.Properties[ConfigurationStrings.MaximumErrorResponseLength]
};
foreach (PropertyInformation property in protectedProperties)
if (property.ValueOrigin == PropertyValueOrigin.SetHere)
{
try {
ExceptionHelper.WebPermissionUnrestricted.Demand();
} catch (Exception exception) {
throw new ConfigurationErrorsException(
SR.GetString(SR.net_config_property_permission,
property.Name),
exception);
}
}
}