Problem: When IIS 7.0 server is configured to work in shared configuration mode then configuration files are stored on a file share. This configuration is recommended for setting up web farms. But in case file share goes offline, the whole set up fails and web servers stop responding. Moreover when the file share comes up again, IIS server is not able to detect it gives following error message:
HTTP Error 500.19 - internal server errorThe requested page cannot be accessed because the related configuration data for the page is invalid.
We have to do an IISreset to start the web servers again after this.
Resolution: Follow the below given steps to set up shared configuration with offline files (client side caching) enabled.
Step 1: On the Web server, in Control Panel, open Offline Files.
Step 2: In the Offline Files dialog box, click Enable Offline Files. Do not reboot the machine yet.
Step 3: Ensure that the cache is set to read only by running the following command:REG ADD "HKLM\System\CurrentControlSet\Services\CSC\Parameters" /v ReadOnlyCache /t REG_DWORD /d 1 /f
Step 4: Reboot the Web server.
Step 5: Browse to the file share folder from web server. Right click and select “Always Available Offline”. Step 6: Go to control panel -- > Offline Files. Select Schedule option. Step 7: Schedule offline file sync after every 1 day or as per the requirement. This could be in minutes too. Even without setting up any scheduler, the moment I change anything in applicationhost.config file, it is reflected on the web server. Now the web server works fine even if the file share is offline and there is no need of IISReset now.
Many thanks to Amol Mehrotra for helping with the content.