Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

IIS6 doesn't recognize changes to config file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Roger Martin - 24 Jul 2007 03:04 GMT
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
Juan T. Llibre - 24 Jul 2007 03:26 GMT
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/
======================================

>I have referenced a separate config file in my application using the
> following syntax in web.config:
[quoted text clipped - 12 lines]
> Roger Martin
> www.techinfosystems.com / www.galleryserverpro.com
Roger Martin - 24 Jul 2007 03:40 GMT
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?
Walter Wang [MSFT] - 24 Jul 2007 12:26 GMT
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 (wawang@online.microsoft.com, 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.
Roger Martin - 24 Jul 2007 15:02 GMT
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
Juan T. Llibre - 24 Jul 2007 14:12 GMT
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/
======================================
> 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?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.