Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6037245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:02:42+00:00 2026-05-23T06:02:42+00:00

It is easy to set settings in the web.config by typing them into the

  • 0

It is easy to set settings in the web.config by typing them into the xml file. However, I would like set some settings at runtime.

Specifically I want to set the system.web/httpRuntime/WaitChangeNotification setting.

I’ve tried this, but it throws an error which says the configuration is readonly.

var section = HttpContext.Current.GetSection("system.web/httpRuntime") as System.Web.Configuration.HttpRuntimeSection;
section.WaitChangeNotification = 6;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T06:02:43+00:00Added an answer on May 23, 2026 at 6:02 am

    It’s not a good idea, but this is entirely possible using reflection.

    Here is a code example of injecting a Soap extension into the web services section of the app config:

    // Turn the read only field non-readonly
    WebServicesSection wss = WebServicesSection.Current;
    SoapExtensionTypeElement e = new SoapExtensionTypeElement(typeof (TraceExtension), 1, PriorityGroup.High);
    
    FieldInfo readOnlyField = typeof(System.Configuration.ConfigurationElementCollection).GetField("bReadOnly", BindingFlags.NonPublic | BindingFlags.Instance);
    readOnlyField.SetValue(wss.SoapExtensionTypes, false);
    
    // Bind to web services section of config
    wss.SoapExtensionTypes.Add(e);
    
    // Restore the original so other things don't break
    MethodInfo resetMethod = typeof(System.Configuration.ConfigurationElementCollection).GetMethod("ResetModified", BindingFlags.NonPublic | BindingFlags.Instance);
    resetMethod.Invoke(wss.SoapExtensionTypes, null);
    
    MethodInfo setReadOnlyMethod = typeof(System.Configuration.ConfigurationElementCollection).GetMethod("SetReadOnly", BindingFlags.NonPublic | BindingFlags.Instance);
    setReadOnlyMethod.Invoke(wss.SoapExtensionTypes, null);
    

    Obviously this is not retrospective so it will only affect values pulled out of the config after it’s been done.

    …and once again, you probably don’t want to do this, but it is possible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Flat-file JMS authentication is easy to set up on Glassfish (see http://docs.sun.com/app/docs/doc/821-0027/aeofg?a=view ). The
Is there currently any easy way to set up a YAWS web server in
I would like to set a specific cookie domain for my cookies, because this
It's very easy to set a text editor to use spaces or tab characters
it's fairly easy to set up Eclipse to run a django project's tests created
In SharePoint, it is easy to set up a List webpart consisting of Links
It's easy enough to set up a table view to allow editing. Just add
Is there an easy way to set the zoom level for a windows form
Is there an easy way to set the volume from managed .net code?
By any chance, is there any easy way to set a default MasterView for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.