Deleting ASP.NET application subdirectories causes application recycle!
- by geekrutherford
This may not be news to most people, but was definitely a shock to me!
In the .NET 2.x framework a "feature" was implemented where by an ASP.NET application is automatically recycled if any subdirectory is deleted. This was apparently implemented to prevent stale content from appearing on a site.
The unfortunate side effect of this "feature" is that when using the "InProc" model for session management, all session data is lost if a subdirectory is deleted.
For those who progammatically may be adding/deleting directories within their application as inherent functionality, this causes a rather large problem.
The solution? Create your folder(s) which may be programmatically deleted outside of the root folder for the application. Alernatively, utilize a file based structure vs. folders since deleting files does not result in the same issue.