external configuration sections - refresh after changing content

Discussion in 'ASP .Net' started by Andrea Anastasescu, Aug 3, 2007.

  1. Hi everybody,

    Inside the web.config of my application I have some custom sections. I have
    my own handlers for these sections, and their content is in external files.
    My problem is that ConfigurationManager do not detects that these external
    files are changed.
    In case that I "touch" the web.config file, just save it or something, the
    content of the files are re-read.
    Is there any possibility to make ConfigurationManager detect that these
    external files are modified and do a refresh automatically, or what is your
    advise, what can I d to have access to the new content of these sections?


    Web.config look smth similar to:
    <configSections>
    <section name="content" type="MyConfig.XmlConfigurationHandler,
    MyConfig"/>
    </configSections>
    <content fileName="ContentSite.xml"/>
    .....
    </configuration>

    I am accesing the external sections somehow similar to these:

    contentSite = ConfigurationManager.GetSection("content") as MyContentType;
    I tried also accesing them as:

    contentSite = WebConfigurationManager.GetSection("content") as
    MyContentType;

    I read about restartOnExternalChanges="true/false" attribute for sections,
    but it was a little bit controversial whether it is appliable for web
    applications, and anyway I tried it and it is not working for me.



    Thank you in advance,

    Andrea
     
    Andrea Anastasescu, Aug 3, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UGFsb21hIEdhcmPDrWE=?=

    Error trying to read Custom Configuration Sections

    =?Utf-8?B?UGFsb21hIEdhcmPDrWE=?=, Sep 26, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    459
    Kevin Spencer
    Sep 26, 2005
  2. Mark
    Replies:
    0
    Views:
    831
  3. hazz
    Replies:
    6
    Views:
    49,632
    SkyUCHC
    Jun 9, 2010
  4. Raman
    Replies:
    6
    Views:
    4,727
    santosh
    Aug 3, 2007
  5. David Williams

    Custom Configuration Sections in Location Tag

    David Williams, Oct 2, 2008, in forum: ASP .Net
    Replies:
    4
    Views:
    375
    David Williams
    Oct 3, 2008
Loading...

Share This Page