Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > external configuration sections - refresh after changing content

Reply
Thread Tools

external configuration sections - refresh after changing content

 
 
Andrea Anastasescu
Guest
Posts: n/a
 
      08-03-2007
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






 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error: Only Content controls are allowed directly in a content page that contains Content controls. hazz ASP .Net 6 06-09-2010 01:54 PM
Custom Configuration Sections in Location Tag David Williams ASP .Net 4 10-03-2008 04:04 PM
function-sections and data-sections option in gcc Raman C Programming 6 08-03-2007 10:40 AM
Configuration reverted to previous configuration after power loss ward@sciinc.com Cisco 0 03-03-2006 04:14 PM
Error trying to read Custom Configuration Sections =?Utf-8?B?UGFsb21hIEdhcmPDrWE=?= ASP .Net 1 09-26-2005 11:27 AM



Advertisments