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
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