By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,903 Members | 1,439 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,903 IT Pros & Developers. It's quick & easy.

external configuration sections - refresh after changing content

P: n/a
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


Aug 3 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.