Synchronizing ASP.NET content to an IIS server results in the IIS site restarting

Starting with ASP.NET 2.0, Microsoft has added "folder deletes" to the list of events that cause an AppDomain restart in IIS. This causes the web site in question to basically be restarted and can interrupt web site availability for users. This happens with any folder delete and not just those performed by SureSync.

When SureSync synchronizes a file to a destination, the initial copy is made to a temporary file. This allows SureSync to perform error checks and recovery as necessary without impacting the destination file. The destination file is only replaced when the transfer is verified successful. SureSync 6.0 introduced file resumes and that feature requires that file transfers in progress be stored in temporary folders. During standard operation, a temporary file will be copied into the temporary folder. When the copy is completed, the file will be moved to replace the destination file and the temporary folder will be deleted if no other temporary files are present in it. This results in more folder deletes as part of the synchronization process compared to previous versions of SureSync. Due to the way ASP.NET 2.0 and IIS treat folder deletes, this can cause a problem with web sites being restarted constantly.

This problem can be addressed by making a change to your ASP.NET application to prevent "folder delete" events from causing the AppDomain restart in IIS. The bottom of this article includes sample code in VB of the necessary changes. Be sure to follow the comments in the code to implement the solution. You should also read the articles below completely before proceeding with implementation. Once the code change has been implemented, you should be able to synchronize content with SureSync and experience no issue with the web sites restarting.

http://ashishgandhi.wordpress.com/2010/12/22/stop-iis-appdomain-restarts-when-a-folder-is-deleted/
Example VB Code of Necessary Changes

Click here to access the example.