IIS6 doesn't recognize changes to config file

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
 
J

Juan T. Llibre

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

Guest

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

Walter Wang [MSFT]

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

Juan T. Llibre

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

Guest

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
 

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,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top