Scenario: Many users (between 10 & 100) are browsing the site, and as they browse, URL Rewrite / Redirect rules are being toggled. The application crashes at random times with the following message logged in the exception log table (we use Enterprise Library Exception framework):
Common Language Runtime detected an invalid program
Details:
An exception of type 'System.InvalidProgramException' occurred and was caught. ------------------------------------------------------------------------------ 07/12/2011 12:02:20 Type : System.InvalidProgramException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Message : Common Language Runtime detected an invalid program. Source : App_Web_wvjyf0pr Help link : Data : System.Collections.ListDictionaryInternal TargetSite : System.Web.UI.WebControls.Panel __BuildControlpnlSearchResult() Stack Trace : at ASP.my_underscore_seperated_page_name_aspx.function() at ...
Server: Windows 2008R2
.Net: 3.5
WebServer: IIS7
Oddly, on enabling failed request tracing on IIS to capture status codes 400 - 506, no requests/responses were captured.
I understand every time a rule is toggled, Web.config is modified. Can modifiying Web.config too frequently be a cause?
Rules in Web.Config look like the follows:
<rule name="Redirect Rule For Page Name" enabled="false" stopProcessing="true">
<match url="PageName" />
<conditions>
<add input="SiteFolder/SubFolder/PageName.aspx" pattern="^(SiteFolder/)([^.])+(PageName.aspx)$" />
</conditions>
<action type="Redirect" url="http://www.MySite/SiteFolder/NewPage.aspx" appendQueryString="false" />
</rule>
Any help is appreciated.