external configuration sections - refresh after changing content

  • Thread starter Andrea Anastasescu
  • Start date
A

Andrea Anastasescu

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top