IIS6 doesn't recognize changes to config file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have referenced a separate config file in my application using the
following syntax in web.config:

<galleryServerPro configSource="config\galleryserverpro.config"/>

There are several admin pages that modify one or more settings in this file,
and I need the application to automatically recycle when this happens so that
it loads the new values. Under IIS7 (Vista) this works fine. However, IIS6
does not recycle the app when this file changes.

What is the recommended solution? I can probably add code to "touch" the
web.config file as needed, but this feels like a hack. Is there a better way?

Cheers,
Roger Martin
www.techinfosystems.com / www.galleryserverpro.com
 
To enable the configuration to be recognized on any change to "galleryserverpro.config",
edit machine.config, in the <configSections> section, and edit <section name="appSettings" ... >,
adding : restartOnExternalChanges="true"


That'd make it :


<section name="appSettings" type="System.Configuration.AppSettingsSection, System.Configuration,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" restartOnExternalChanges="true"
requirePermission="false" />

The same for the connectionStrings section.



Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
 
Thank you for responding. However, this is an application I am distributing
on the internet and many users will be using a hosting provider where they do
not have access to machine.config, so this is not a practical solution.

Is there any way to set this at the application level?
 
Hi Roger,

It appears that you're using a custom section, right? In that case, I think
you're defining that custom section in your web.config, is that right?
Therefore you should be able to turn on the "restartOnExternalChanges"
option in your web.config.

Here's an example on this:

#Changing Configuration in External File Example
http://msdn2.microsoft.com/en-us/library/ms228057(vs.80).aspx


Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
re:
!> Is there any way to set this at the application level?

You can define your custom section in web.config,
and distribute your custom web.config to your clients.




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
 
Thanks Walter! Using restartOnExternalChanges in the custom section in
web.config is exactly what the doctor ordered. Ahh, I feel much better now...

Cheers,
Roger
 
Back
Top