You can stop repeated IIS or Azure Web App restarts caused by file-change notifications by ensuring that IIS disables file-change monitoring in the configuration that applies to your MDrivenServer or Turnkey application.
Recognize this restart cause
Check the MDrivenServer or Turnkey log files when the application restarts repeatedly. This page applies when the log indicates an IIS or Azure Web App restart caused by change notifications, for example:
Azure Web App Restarting Automatically Due to Overwhelming Change Notification or IIS Configuration Change.
IIS monitors changes to files in a web application. After enough detected changes, IIS can recycle the application pool. MDrivenServer and Turnkey control their own site updates, so this behaviour must be disabled for the application.
Disable file-change notifications
The fcnMode setting controls file-change notifications. Set it to Disabled in the applicable web.config file.
<httpRuntime maxRequestLength="2147483647" executionTimeout="300" targetFramework="4.5" requestValidationMode="2.0" fcnMode="Disabled" />
Both MDrivenServer and Turnkey include this setting in their own configuration. In a normal deployment, confirm that the application's web.config has not been replaced or changed during deployment or upgrade.
Fix an application below an otherwise empty IIS site root
You need an additional root-level web.config when MDrivenServer is installed as an IIS application in a subdirectory, such as __MDrivenServer, and no Turnkey server is installed in the IIS site root.
For example, if the IIS site points to a root folder and MDrivenServer is located at:
<site root>\__MDrivenServer
place a web.config in <site root>, not only in __MDrivenServer. Use the following configuration:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="__MDrivenServer">
<system.web>
<httpRuntime maxRequestLength="2147483647" executionTimeout="300" targetFramework="4.5" requestValidationMode="2.0" fcnMode="Disabled" />
</system.web>
</location>
<system.web>
<httpRuntime maxRequestLength="2147483647" executionTimeout="300" targetFramework="4.5" requestValidationMode="2.0" fcnMode="Disabled" />
</system.web>
</configuration>
The location element applies the setting to the __MDrivenServer application. The root system.web section applies the same setting at the IIS site root. This prevents the unconfigured root level from continuing to trigger file-change notification recycling.
Apply the configuration
- Identify the physical IIS site root and the application path in IIS Manager. Do not assume that the application folder is the site root.
- If MDrivenServer is in
__MDrivenServerand the site root has no Turnkey installation, create or updateweb.configin the site root with the configuration above. - Confirm that the
pathvalue in<location>matches the actual MDrivenServer application directory. For the example configuration, the directory must be named__MDrivenServer. - Recycle the affected application pool, or restart the Azure Web App.
- Monitor the MDrivenServer or Turnkey logs to confirm that the repeated restart message no longer appears.
Scope and common mistakes
| Situation | What to do |
|---|---|
| Turnkey or MDrivenServer is installed at the IIS site root | Verify that its own web.config retains fcnMode="Disabled".
|
MDrivenServer is installed in __MDrivenServer below an otherwise empty site root
|
Add the root-level web.config shown above.
|
| The application still fails to start, but the change-notification message is absent | This is a different problem. Follow HowTos:Troubleshooting IIS application startup issues. |
| You are deploying or changing the IIS site structure | Follow Documentation:Deploying MDriven Server & Turnkey Core on IIS for application pools, bindings, configuration files, and log locations. |
Do not use app_offline.htm as a fix for restart loops. That file intentionally takes an application offline during maintenance; see Documentation:Maintenance page.
Related IIS configuration
Repeated restarts can also be caused by application-pool recycling or startup failures rather than file-change notifications. Keep those investigations separate:
- Use HowTos:Troubleshooting IIS application startup issues when Turnkey does not start or server-side work is re-entered after a recycle.
- Use Documentation:AppPool user to verify that the IIS application-pool identity has the required file-system access for both MDrivenServer and Turnkey.
- Use HowTos:Installing MDriven Server on Windows for IIS and application-pool setup guidance.
- If you create sites or applications with automation, review HowTos:PowerShell script for IIS installation so that the IIS site root and application placement are clear.
