Microsoft KB Archive/312592

= PRB: Random application restarts with &quot;Application is restarting&quot; error in ASP.NET =

Article ID: 312592

Article Last Modified on 9/10/2007

-

APPLIES TO


 * Microsoft ASP.NET 1.1
 * Microsoft ASP.NET 1.0
 * Microsoft ASP.NET 2.0

-



This article was previously published under Q312592



SYMPTOMS
When you run ASP.NET on a computer that is using antivirus software with real-time monitoring enabled, you may notice that a random application restarts, and you receive the following error message in the browser:

Application is restarting.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Application is restarting.



CAUSE
This problem occurs because of some antivirus applications write back information to the files that they scan. Every time a user changes the Web.config configuration file, the Global.asax file, or the contents of the Bin folder, the application should restart to incorporate these changes. Because antivirus scanning changes cannot be distinguished from the user's file changes, the application restarts when the antivirus software scans these folders.

Note This problem may occur even when no error is returned. If the virus-scanning software triggers change notifications, every change notification is doubled at the very least: one real change notification and an additional change notification from the antivirus software some time later.



RESOLUTION
Use one of the following methods to resolve this problem:
 * Disable real-time monitoring in your antivirus software.
 * Exclude the application folders from the antivirus scan list.

Please consult your antivirus software documentation for instructions about how to change these settings.

With some antivirus software, you may be able to increase the delayNotificationTimeout attribute of the  configuration section in the Web.config file to work around this problem. This value is set with the following entry in the Web.config file:  The default value is 5 seconds, which is sometimes not enough for specific hardware. To resolve the problem on your computer, you must increase the time-out value to a value that works for your hardware and computer speed (for example 60).



STATUS
This behavior is by design.



MORE INFORMATION
If the file update occurs while the first request is being processed, ASP.NET rejects the request and displays the &quot;Application is restarting&quot; error because the notification occurs before the application is fully compiled.

