<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="it-IT"><title type="html">Never doubt thy debugger</title><subtitle type="html" /><id>http://blogs.msdn.com/b/carloc/atom.aspx</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/carloc/" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/b/carloc/atom.aspx" /><generator uri="http://telligent.com" version="5.6.50428.7875">Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><updated>2009-04-14T22:45:37Z</updated><entry><title>How to export IIS .config and .key files at the command line</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/carloc/archive/2013/01/09/how-to-export-iis-config-and-key-files-at-the-command-line.aspx" /><id>http://blogs.msdn.com/b/carloc/archive/2013/01/09/how-to-export-iis-config-and-key-files-at-the-command-line.aspx</id><published>2013-01-09T09:50:17Z</published><updated>2013-01-09T09:50:17Z</updated><content type="html">&lt;p&gt;Handy for a batch maintenance operation a customer had to run on a few hundreds servers: they basically needed to do what’s described in &lt;a href="http://technet.microsoft.com/en-us/library/cc753268(WS.10).aspx" target="_blank"&gt;this article&lt;/a&gt; but in a script rather than from the IIS GUI.&lt;/p&gt;  &lt;p&gt;From &lt;a href="http://www.iis.net/learn/manage/managing-your-configuration-settings/shared-configuration_264#13" target="_blank"&gt;Shared Configuration (Appendix 3)&lt;/a&gt;:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;By default, IIS includes two main providers for securing properties. These providers are located in the applicationHost.config file's &amp;lt;configProtectedData&amp;gt; configuration section and are defined in the &amp;lt;providers&amp;gt; element. The AesProvider is specific to dealing with encryption and decryption for properties that are in the system.webServer section. The IISWASOnlyRsaProvider is specific to dealing with encryption and decryption for properties that are in the system.applicationHost section. These keys are in the iisConfigurationKey and iisWasKey key containers and are machine-specific. In a Web farm scenario, if encryption is required, then a key from one machine - usually the one that created the applicationHost.config file - is exported and brought into the other machines so that secure properties can be decrypted and used by the Web server&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;So just copy the .config files from “C:\Windows\System32\Inetsrv\config” and use aspnet_regiis –px to export the Keys:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;aspnet_regiis -px &amp;quot;iisConfigurationKey&amp;quot; &amp;quot;D:\iisConfigurationKey.xml&amp;quot; -pri&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;To import the Keys on another machine run the following:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;aspnet_regiis -pi &amp;quot;iisConfigurationKey&amp;quot; &amp;quot;D:\iisConfigurationKey.xml&amp;quot;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The parameter after the &lt;strong&gt;-pi&lt;/strong&gt; is the name of the key container to be imported. In this case, it is the &amp;quot;iisConfigurationKey&amp;quot; key container. The other key container that IIS uses is the &amp;quot;iisWasKey&amp;quot; key container. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Segoe Print"&gt;Carlo&lt;/font&gt;&lt;/p&gt; &lt;b&gt;The difference between the right word and the almost right word is the difference between lightning and a lightning bug.&lt;/b&gt;   &lt;p&gt;&lt;a href="http://quotes4all.net/mark%20twain.html"&gt;Mark Twain&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10383405" width="1" height="1"&gt;</content><author><name>Carlo  Cardella</name><uri>http://blogs.msdn.com/carloc/ProfileUrlRedirect.ashx</uri></author><category term="IIS" scheme="http://blogs.msdn.com/b/carloc/archive/tags/IIS/" /></entry><entry><title>Error 502 - Web server received an invalid response while acting as a gateway or proxy server</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/carloc/archive/2013/01/09/error-502-web-server-received-an-invalid-response-while-acting-as-a-gateway-or-proxy-server.aspx" /><id>http://blogs.msdn.com/b/carloc/archive/2013/01/09/error-502-web-server-received-an-invalid-response-while-acting-as-a-gateway-or-proxy-server.aspx</id><published>2013-01-09T09:30:56Z</published><updated>2013-01-09T09:30:56Z</updated><content type="html">&lt;p&gt;I saw this error some time ago while working on an eCommerce solution. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server. Redirect/move happens like it should, but after approximatively 2 minutes after posting an order the user receives an http error 502.   &lt;br /&gt; The order is correctly processed by SAP but the web applications is built in a way that the user is getting a confirmation page when the order is processed: this page is never presented to the user due to the 502 error.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.iis.net/learn/troubleshoot/using-failed-request-tracing/troubleshooting-failed-requests-using-tracing-in-iis" target="_blank"&gt;FREB&lt;/a&gt; gave us further details about the error: 502.3, 2147954417 which translates into ERROR_INTERNET_OPERATION_CANCELLED.&lt;/p&gt;  &lt;p&gt;This lead me to &lt;a href="http://blogs.iis.net/richma/archive/2010/07/03/502-3-bad-gateway-the-operation-timed-out-with-iis-application-request-routing-arr.aspx" target="_blank"&gt;this post&lt;/a&gt; which describes a different error but based on the same principle and the solution still applies to our scenario: we increased the proxy timeout to 5 minutes to accommodate all reasonably long running requests and the problem was solved.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;appcmd.exe set config&amp;#160; -section:system.webServer/proxy /timeout:&amp;quot;00:05:00&amp;quot;&amp;#160; /commit:apphost&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Segoe Print"&gt;Carlo&lt;/font&gt;&lt;/p&gt; &lt;b&gt;It's not the size of the dog in the fight, it's the size of the fight in the dog.&lt;/b&gt;   &lt;p&gt;&lt;a href="http://quotes4all.net/mark%20twain.html"&gt;Mark Twain&lt;/a&gt;&lt;/p&gt;   &lt;font color="#000080" size="2" face="Segoe Print"&gt;&lt;/font&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10383401" width="1" height="1"&gt;</content><author><name>Carlo  Cardella</name><uri>http://blogs.msdn.com/carloc/ProfileUrlRedirect.ashx</uri></author><category term="IIS" scheme="http://blogs.msdn.com/b/carloc/archive/tags/IIS/" /><category term="ARR" scheme="http://blogs.msdn.com/b/carloc/archive/tags/ARR/" /></entry><entry><title>Moving to Windows 2008: smartcard slow performance?</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/carloc/archive/2010/11/15/moving-to-windows-2008-smartcard-slow-performance.aspx" /><id>http://blogs.msdn.com/b/carloc/archive/2010/11/15/moving-to-windows-2008-smartcard-slow-performance.aspx</id><published>2010-11-15T11:00:00Z</published><updated>2010-11-15T11:00:00Z</updated><content type="html">&lt;p&gt;Suppose you have a web application which authenticates clients through a smartcard certificate and everything is working fine, then you decide to move your web application to Windows Server 2008 (which is a good decision in many ways &lt;img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Winking smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/4532.wlEmoticon_2D00_winkingsmile_5F00_2DD3B7E6.png" /&gt;) but your users are suddenly complaining about slow performance, pages are loading slower than they used to do and you cannot find any explanation on the network infrastructure, everything seems to be properly configured on the client and on the server… what is happening?&lt;/p&gt;  &lt;p&gt;Well, as you can imagine this is what happened to a customer I worked with recently. A closer look at the client showed that every time a new object in the page was loaded (images, script files, css…) the smartcard was checked for the certificate, resulting in a major performance loss.&lt;/p&gt;  &lt;p&gt;To make the story short, the behavior is controlled by &lt;em&gt;client certificate negotiation&lt;/em&gt;, specifically by &lt;a href="http://www.iis.net/ConfigReference/system.webServer/security/access" target="_blank"&gt;SSLAlwaysNegoClientCert&lt;/a&gt; which in IIS 7 has been moved to http.sys (see &lt;a title="http://learn.iis.net/page.aspx/110/changes-between-iis-60-and-iis-7-security/" href="http://learn.iis.net/page.aspx/110/changes-between-iis-60-and-iis-7-security/" target="_blank"&gt;http://learn.iis.net/page.aspx/110/changes-between-iis-60-and-iis-7-security/&lt;/a&gt;); you can configure the&amp;#160; &amp;lt;access&amp;gt; element as described or using &lt;a href="http://technet.microsoft.com/en-us/library/cc785383(WS.10).aspx" target="_blank"&gt;netsh&lt;/a&gt; with a command such as the following:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;netsh http add sslcert ipport=0.0.0.0:$port certstorename=MY certhash=$Certhash appid=$Appnr sslctlidentifier=$CTLlijst sslctlstorename=CA clientcertnegotiation=enable&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Segoe Print"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Segoe Print"&gt;Carlo&lt;/font&gt;&lt;/p&gt; &lt;b&gt;&lt;i&gt;Quote of the day: &lt;/i&gt;&lt;/b&gt;  &lt;br /&gt;Human beings are perhaps never more frightening than when they are convinced beyond doubt that they are right. - &lt;a href="http://en.wikipedia.org/wiki/Laurens_Van_Der_Post" target="_blank"&gt;Laurens Van der Post&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10091019" width="1" height="1"&gt;</content><author><name>Carlo  Cardella</name><uri>http://blogs.msdn.com/carloc/ProfileUrlRedirect.ashx</uri></author><category term="IIS" scheme="http://blogs.msdn.com/b/carloc/archive/tags/IIS/" /><category term="Security" scheme="http://blogs.msdn.com/b/carloc/archive/tags/Security/" /></entry><entry><title>Automatic postback does not fire for TextBox control</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/carloc/archive/2010/10/29/automatic-postback-does-not-fire-for-textbox-control.aspx" /><id>http://blogs.msdn.com/b/carloc/archive/2010/10/29/automatic-postback-does-not-fire-for-textbox-control.aspx</id><published>2010-10-29T16:40:00Z</published><updated>2010-10-29T16:40:00Z</updated><content type="html">&lt;p&gt;I recently come across an interesting request which read like this: &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;A simple webapplication with one Textbox and one label. The Textbox has Autopostback=”true” and has an event listener attached to the TextChanged event. In the TextChanged event the label’s text is set to the text in the textbox. A javascript function “formats” the value of the textbox on the keyUp event.&amp;#160;&amp;#160; The ”problem” The postback is not fired for a textbox if a javascript function sets the value of the textbox in the keyDown or keyUp event. This only occurs in IE (IE 8, IE 7, FF 3.6.8, Opera 10.6 and Chrome 5 has been tested). No javascript errors or any kind of error message, the postback is just not being fired.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And here’s a sample page to reproduce the problem:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="background-color: #ffff00"&gt;&lt;font style="background-color: #ffffff"&gt;&amp;lt;%&lt;/font&gt;&lt;/span&gt;@ Page Language=&amp;quot;vb&amp;quot; AutoEventWireup=&amp;quot;false&amp;quot; ValidateRequest=&amp;quot;false&amp;quot; EnableEventValidation=&amp;quot;false&amp;quot; EnableViewStateMac=&amp;quot;false&amp;quot; %&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;!&lt;/span&gt;&lt;span style="color: #800000"&gt;DOCTYPE&lt;/span&gt; &lt;span style="color: #ff0000"&gt;html&lt;/span&gt; &lt;span style="color: #ff0000"&gt;PUBLIC&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;html&lt;/span&gt; &lt;span style="color: #ff0000"&gt;xmlns&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;head&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;       &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;title&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;title&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;       &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt; type=&amp;quot;text/javascript&amp;quot; language=&amp;quot;javascript&amp;quot;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        function FormatTextBox(obj) {&lt;br /&gt;            &lt;font color="#288c28"&gt;//This is just a dummy function that adds $ as the first character.&lt;br /&gt;&lt;/font&gt;            var value = obj.value&lt;br /&gt;&lt;br /&gt;            if (value.length &lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; 0 &amp;amp;&amp;amp; value.charAt(0) != '$')&lt;br /&gt;                value = '$' + value;&lt;br /&gt;&lt;br /&gt;            obj.value = value; &lt;font color="#288c28"&gt;&lt;font style="background-color: #ffff00"&gt;// This line causes the autopostback not to fire. This only happens if the value of the input &lt;br /&gt;&lt;/font&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font style="background-color: #ffff00"&gt;// is set in the keyup or keydown event and only in IE.&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;        }&lt;br /&gt;       &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;       &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt; language=&amp;quot;vbscript&amp;quot; runat=&amp;quot;server&amp;quot;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;             &lt;font color="#288c28"&gt;'Just to have something happening during the autopostback.&lt;br /&gt;&lt;/font&gt;             Private Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged&lt;br /&gt;                    Label1.Text = TextBox1.Text&lt;br /&gt;             End Sub&lt;br /&gt;       &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;head&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;body&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;       &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;form&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;form1&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;       &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;             &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;asp:TextBox&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;TextBox1&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;onkeyup&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;return FormatTextBox(this);&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;AutoPostBack&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;asp:TextBox&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;             &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;asp:Label&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Label1&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Text&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Label&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;asp:Label&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;       &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;       &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;form&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;body&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;html&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Type something in the textbox then hit TAB (or click somewhere on the white page) and you’ll see nothing happens, while you should have a postback and the Label should reflect the text you typed (plus the “$” sign added by the FormatTextBox function). Interestingly enough if you type only one character in the TextBox you’ll have the problem, if you type in two or more characters then everything will work. Another interesting effect: if you type the dollar sign (“$”) which happens to be the sign added by javascript, you’ll never have an automatic postback no matter how many “$” you’ll type in.&lt;/p&gt;

&lt;p&gt;Why is it happening? Well, any time you type a new character into the TextBox, IE compares the new value to some internal 'initial' value that it it keeping to see if the text has changed.&amp;#160; However, when you set the value of the TextBox programmatically, IE makes the assumption that you know what just happened and that it doesn't have to fire the onChange event.&amp;#160; So it resets its internal tracking value to be the same as the value you just programmatically set.&amp;#160; Then when you tab out of focus, the two values are the same and no onChange event gets fired.&lt;/p&gt;

&lt;p&gt;So, how to deal with it? The easiest solution is to use the OnBlur event &lt;em&gt;or&lt;/em&gt;, &lt;/p&gt;

&lt;p&gt;if you really need to hook on the onkeyup event, is to track the state of the TextBox on your own and force the onchange event to fire, even if you programatically set the TextBox value.&amp;#160; Use a TextBox like this:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;asp:TextBox&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;TextBox1&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;onkeyup&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;FormatTextBoxDirty(this)&amp;quot;&lt;/span&gt; &lt;br /&gt;            &lt;span style="color: #ff0000"&gt;onblur&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;if (this.dirty){this.onchange();}&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;AutoPostBack&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;and javascript like this:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; FormatTextBoxDirty(obj) {&lt;br /&gt;        obj.dirty = &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;;  &lt;span style="color: #008000"&gt;// This prevents firing onchange twice in the event that we don't modify the value&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (obj.value.length &amp;gt; 0 &amp;amp;&amp;amp; obj.value.charAt(0) != &lt;span style="color: #006080"&gt;'$'&lt;/span&gt;) {&lt;br /&gt;            obj.value = &lt;span style="color: #006080"&gt;'$'&lt;/span&gt; + obj.value;&lt;br /&gt;            obj.dirty = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;&lt;br /&gt;        }&lt;br /&gt;    }&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;
Here’s the working page: 

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;%@ Page Language=&amp;quot;vb&amp;quot; AutoEventWireup=&amp;quot;false&amp;quot; ValidateRequest=&amp;quot;false&amp;quot; EnableEventValidation=&amp;quot;false&amp;quot; EnableViewStateMac=&amp;quot;false&amp;quot; %&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;!&lt;/span&gt;&lt;span style="color: #800000"&gt;DOCTYPE&lt;/span&gt; &lt;span style="color: #ff0000"&gt;html&lt;/span&gt; &lt;span style="color: #ff0000"&gt;PUBLIC&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;html&lt;/span&gt; &lt;span style="color: #ff0000"&gt;xmlns&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;head&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Head1&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;title&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;title&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt; type=&amp;quot;text/javascript&amp;quot; language=&amp;quot;javascript&amp;quot;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        function FormatTextBox(obj) {&lt;br /&gt;            //This is just a dummy function that adds $ as the first character.&lt;br /&gt;            var value = obj.value&lt;br /&gt;&lt;br /&gt;            if (value.length &lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; 0 &amp;amp;&amp;amp; value.charAt(0) != '$')&lt;br /&gt;                value = '$' + value;&lt;br /&gt;&lt;br /&gt;            obj.value = value; // This line causes the autopostback not to fire. This only happens if the value of the input &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // is set in the keyup or keydown event and only in IE.&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        function FormatTextBoxDirty(obj) {&lt;br /&gt;            obj.dirty = false;  &lt;font style="background-color: #ffff00" color="#288c28"&gt;// This prevents firing onchange twice in the event that we don't modify the value&lt;br /&gt;&lt;/font&gt;            if (obj.value.length &lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; 0 &amp;amp;&amp;amp; obj.value.charAt(0) != '$') {&lt;br /&gt;                obj.value = '$' + obj.value;&lt;br /&gt;                obj.dirty = true;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt; language=&amp;quot;vbscript&amp;quot; runat=&amp;quot;server&amp;quot;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        'Just to have something happening during the autopostback.&lt;br /&gt;        Private Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged&lt;br /&gt;            Label1.Text = TextBox1.Text&lt;br /&gt;        End Sub&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;head&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;body&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;form&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;form1&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;asp:TextBox&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;TextBox1&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;onkeyup&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;FormatTextBoxDirty(this)&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;onblur&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;if (this.dirty){this.onchange();}&amp;quot;&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: #ff0000"&gt;AutoPostBack&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;asp:Label&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Label1&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Text&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Label&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;asp:Label&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;form&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;body&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;html&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;P.s. 
  &lt;br /&gt;Thanks to Steve Molloy for this help on this matter. 

  &lt;br /&gt;

  &lt;br /&gt;

  &lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000080" size="2" face="Segoe Print"&gt;Carlo&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;i&gt;Quote of the day: &lt;/i&gt;&lt;/b&gt;

  &lt;br /&gt;Minds are like parachutes: they only work when they are open – Anonymous&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10083095" width="1" height="1"&gt;</content><author><name>Carlo  Cardella</name><uri>http://blogs.msdn.com/carloc/ProfileUrlRedirect.ashx</uri></author><category term="Internet Explorer" scheme="http://blogs.msdn.com/b/carloc/archive/tags/Internet+Explorer/" /><category term="Scripting/ASP" scheme="http://blogs.msdn.com/b/carloc/archive/tags/Scripting_2F00_ASP/" /></entry><entry><title>Sometimes they come back</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/carloc/archive/2010/07/27/sometimes-they-come-back.aspx" /><id>http://blogs.msdn.com/b/carloc/archive/2010/07/27/sometimes-they-come-back.aspx</id><published>2010-07-27T19:58:00Z</published><updated>2010-07-27T19:58:00Z</updated><content type="html">&lt;p&gt;&lt;a target="_blank" href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/www.stephenking.com/"&gt;Stephen King&lt;/a&gt; fans like me for sure know &lt;a target="_blank" href="https://www.stephenking.com/library/story_collection/night_shift_flap.html"&gt;Night Shift&lt;/a&gt;, a collection of 19 short stories I first read almost (oh, my&amp;hellip;) almost 20 years ago. In Italian the title of this collection has been translated as &amp;ldquo;A volte ritornano&amp;rdquo; which literally means &lt;em&gt;Sometimes they come back&lt;/em&gt;. This is exactly what I thought yesterday when I got yet another version of the &amp;ldquo;503 Service Unavailable&amp;rdquo; error: after I have already written about this error &lt;a target="_blank" href="http://blogs.msdn.com/b/carloc/archive/2009/02/04/service-unavailable-in-iis7-with-32-bit-application-pool.aspx" title="http://blogs.msdn.com/b/carloc/archive/2009/02/04/service-unavailable-in-iis7-with-32-bit-application-pool.aspx"&gt;here&lt;/a&gt; and &lt;a target="_blank" href="http://blogs.msdn.com/b/carloc/archive/2009/02/05/again-on-503-service-unavailable-in-iis7-x64.aspx" title="http://blogs.msdn.com/b/carloc/archive/2009/02/05/again-on-503-service-unavailable-in-iis7-x64.aspx"&gt;here&lt;/a&gt;, I&amp;rsquo;m writing the third post about it. I&amp;rsquo;m wondering if I&amp;rsquo;ll end up with a 19 post collection as Night Shift has&amp;hellip; &lt;img src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/6663.wlEmoticon_2D00_whome_5F00_2.png" alt="Who me?" class="wlEmoticon wlEmoticon-whome" style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" /&gt;&lt;/p&gt;
&lt;p&gt;Anyway, here&amp;rsquo;s the new story: the application pools of this web server were failing with the following error&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;i&gt;(eventid 281) The worker process for application pool 'MSExchangeOWAAppPool' encountered an error 'Unrecognized attribute 'precondition' &lt;/i&gt;&lt;i&gt;trying to read global module configuration data from file '\\?\C:\inetpub\temp\apppools\MSExchangeOWAAppPool.config', line number '281'.&amp;nbsp; Worker process startup aborted.&lt;/i&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;As you can see the &lt;em&gt;precondition&lt;/em&gt; keyword is mistyped (it should be &lt;em&gt;preCondition&lt;/em&gt;, capital &amp;ldquo;C&amp;rdquo;) and if we changed the .config file mentioned in the error message we were able to start our application pool but randomly (most of the time after a reboot, though) the problem came back. Interesting to note is the path of the .config file mentioned in the error: C:\inetpub\&lt;span style="color: #ff0000;"&gt;temp\&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;&lt;strong&gt;AppPools&lt;/strong&gt;&lt;/span&gt;\xxxxxx.config &lt;img src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/4048.wlEmoticon_2D00_nerdsmile_5F00_2.png" alt="Nerd smile" class="wlEmoticon wlEmoticon-nerdsmile" style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" /&gt;&lt;/p&gt;
&lt;p&gt;This is where &lt;a target="_blank" href="http://technet.microsoft.com/en-us/library/dd163536.aspx"&gt;Configuration Isolation&lt;/a&gt; stores the application pool specific configuration files:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;IIS worker processes do not have Read access to applicationHost.config. How, then, are they able to read any of the configuration set in this file?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;The answer lies in the configuration isolation feature provided by IIS 7.0, which is always on by default. Instead of enabling IIS worker processes to read applicationHost.config directly when reading the configuration file hierarchy, IIS generates filtered copies of this file and uses these copies as a replacement of applicationHost.config when configuration is read inside the IIS worker process.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;The reason for doing this is to prevent IIS worker processes from application pool A to be able to read configuration information in applicationHost.config that is intended for application pool B. Because applicationHost.config may contain sensitive information, such as the user name and password for custom application pool identities, as well as user name and password for virtual directories, allowing all application pools to access applicationHost.config would break application pool isolation.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;WAS is responsible for generating the temporary application pool configuration files that each IIS worker process uses as a replacement of applicationHost.config. These files are placed by default in the %SystemDrive%\Inetpub\Temp\Apppools directory and are named AppPoolName.config. As mentioned earlier, these files are configured to allow access only to the IIS worker processes in the corresponding application pool, by using the IIS APPPOOL\AppPoolName Application Pool SID.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Note&lt;/strong&gt; This process occurs automatically each time applicationHost.config is changed and therefore does not require any manual action from the administrator outside of normal configuration procedures.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Each application pool configuration file contains the configuration in applicationHost.config, with the following information removed:&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;All application pool definitions in the system.applicationHost/applicationPools configuration section. Only WAS is required to read this configuration section. &lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Any Web site definitions in the system.applicationHost/sites configuration section for sites that do not have applications in the current application pool. &lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Any configuration in location tags for specific Web sites, applications, or URLs that do not reside inside the applications in the current application pool.&lt;/em&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Caution&lt;/strong&gt; All application definitions (and their virtual directory definitions, possibly containing user name and password credentials) for any site that has at least one application in the current application pool will be present in the application pool configuration file. To disable this behavior and include only the application definitions for applications in the application pool, set the IsolationWholeSiteInclude DWORD value to 0 in the HKLM\System\CurrentControlSet\Services\WAS\Parameters key and perform an IISRESET. This may break applications in sites with applications in multiple application pools when they attempt to map physical paths for URLs in other applications.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Keep in mind that global configuration settings set in the applicationHost.config (without using location tags to apply them to specific Web sites, applications, or URLs) are not filtered. Each application pool configuration file will contain all of these settings.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Configuration isolation is a key part of the application pool isolation strategy in IIS 7.0. It is enabled by default to provide configuration isolation for server-level configuration in applicationHost.config. For strategies on achieving proper application pool isolation, see the section titled "Isolating Applications" earlier in this chapter.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Caution&lt;/strong&gt; Configuration stored in .NET Framework machine.config and root web.config files is not isolated. Only configuration stored in applicationHost.config is isolated.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So, this means the mistyped entry very likely originates from &lt;a target="_blank" href="http://learn.iis.net/page.aspx/124/introduction-to-applicationhostconfig/"&gt;applicationHost.config&lt;/a&gt;&amp;hellip; We do not know what (or &lt;em&gt;who&lt;/em&gt; &lt;img src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/2084.wlEmoticon_2D00_winkingsmile_5F00_2.png" alt="Winking smile" class="wlEmoticon wlEmoticon-winkingsmile" style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" /&gt;) changed this since I have the same roles and features installed on my machine as the customer had on his server, but after fixing the typo in the centralized configuration file the problem disappeared.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Segoe Print; color: #000080; font-size: x-small;"&gt;Carlo&lt;/span&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;i&gt;Quote of the day: &lt;/i&gt;&lt;/b&gt;&lt;br /&gt;To avoid situations in which you might make mistakes may be the biggest mistake of all. - &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Peter_McWilliams"&gt;Peter McWilliams&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10043143" width="1" height="1"&gt;</content><author><name>Carlo  Cardella</name><uri>http://blogs.msdn.com/carloc/ProfileUrlRedirect.ashx</uri></author><category term="IIS" scheme="http://blogs.msdn.com/b/carloc/archive/tags/IIS/" /><category term=".NET Framework" scheme="http://blogs.msdn.com/b/carloc/archive/tags/-NET+Framework/" /></entry><entry><title>My GridView does not want to paginate anymore!</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/carloc/archive/2010/07/23/my-gridview-does-not-want-to-paginate-anymore.aspx" /><id>http://blogs.msdn.com/b/carloc/archive/2010/07/23/my-gridview-does-not-want-to-paginate-anymore.aspx</id><published>2010-07-23T14:15:35Z</published><updated>2010-07-23T14:15:35Z</updated><content type="html">&lt;p&gt;Lots of stuff kept me busy over the last few months and this blog has been a bit too quiet… let me try to revamp it a bit (new graphic layout will come later).&lt;/p&gt;  &lt;p&gt;I recently worked on an interesting case where a simple GridView with pagination enabled was not working as expected: every time we clicked a different page (note, &lt;em&gt;page&lt;/em&gt; referred to the GridView pages, not .aspx pages…) we were quickly brought back to the first page: no errors logged anywhere (IIS logs, &lt;a href="http://www.fiddler2.com/" target="_blank"&gt;Fiddler&lt;/a&gt;, event viewer… nothing really useful there). Then we decided to make a quick test: we bypassed the ISA proxy and everything started working fine, no way to reproduce the problem again; needless to say, as soon as we reconfigured the proxy in IE the problem came back.&lt;/p&gt;  &lt;p&gt;My colleague &lt;a href="http://blogs.msdn.com/b/alvar/" target="_blank"&gt;Alvar&lt;/a&gt; works also on ISA cases and suggested the article &lt;a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;942638" target="_blank"&gt;POST requests that do not have a POST body may be sent to a Web server that is published in ISA Server 2006&lt;/a&gt; and this actually did the trick, problem solved! Thanks Alvar &lt;img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://www.devdebug.members.winisp.net/images/msdnblog/MyGridViewdoesnotwanttopaginateanymore_DAE4/wlEmoticonsmile.png" /&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Segoe Print"&gt;Carlo&lt;/font&gt;&lt;/p&gt; &lt;b&gt;&lt;i&gt;Quote of the day: &lt;/i&gt;&lt;/b&gt;  &lt;br /&gt;Great people talk about ideas, average people talk about things, and small people talk about wine. - &lt;a href="http://en.wikipedia.org/wiki/Fran_Lebowitz" target="_blank"&gt;Fran Lebowitz&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10041860" width="1" height="1"&gt;</content><author><name>Carlo  Cardella</name><uri>http://blogs.msdn.com/carloc/ProfileUrlRedirect.ashx</uri></author><category term=".NET Framewor" scheme="http://blogs.msdn.com/b/carloc/archive/tags/-NET+Framewor/" /><category term="ISA Server" scheme="http://blogs.msdn.com/b/carloc/archive/tags/ISA+Server/" /></entry><entry><title>Make your own keyboard for free</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/carloc/archive/2010/04/28/make-your-own-keyboard-for-free.aspx" /><id>http://blogs.msdn.com/b/carloc/archive/2010/04/28/make-your-own-keyboard-for-free.aspx</id><published>2010-04-28T20:23:40Z</published><updated>2010-04-28T20:23:40Z</updated><content type="html">&lt;p&gt;I’ve been using the new &lt;a href="http://www.microsoft.com/hardware/mouseandkeyboard/ProductDetails.aspx?pid=120" target="_blank"&gt;Arc Keyboard&lt;/a&gt; for a few weeks now and I’m very pleased with it, I like it especially for typing. But (there is always a “but” &lt;img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Winking smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/0677.wlEmoticon_2D00_winkingsmile_5F00_2.png" /&gt;)… Unfortunately I have to say this keyboard is not very practical when working with &lt;a href="http://www.microsoft.com/whdc/devtools/debugging/default.mspx" target="_blank"&gt;Windbg&lt;/a&gt; or &lt;a href="http://www.microsoft.com/visualstudio" target="_blank"&gt;Visual Studio&lt;/a&gt; (at least with the Italian layout) where you have to type special characters such as tilde (~) or braches ( &lt;em&gt;{ }&lt;/em&gt; ). Well, it is possible to get braches with the key combination ATL GR+SHIFT+è for the open one and ALT GR+SHIFT++ or ALT+123 and ALT+125 on the numpad if available and despite the weird key combination I got used to press it with only one hand and my typing flow was acceptable, even on a laptop where the numpad cannot be used. Anyway I’ve not been able to find how to get the tilde sign on an Italian keyboard without using the numpad combination (ALT+126), this means I cannot use neither my laptop nor the Arc Keyboard for coding… Should I use two different keyboards, then? No way &lt;img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-shifty" alt="Shifty" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/1258.wlEmoticon_2D00_shifty_5F00_2.png" /&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="www.bing.com/" target="_blank"&gt;Bing&lt;/a&gt; came to the rescue and pointed me to the &lt;a href="http://msdn.microsoft.com/en-us/goglobal/bb964665.aspx" target="_blank"&gt;Keyboard Layout Creator&lt;/a&gt; that, among other things, allows to modify and extend an existing keyboard layout adding new keys and key combinations, and it’s easy to use, too &lt;img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/7041.wlEmoticon_2D00_smile_5F00_2.png" /&gt;.&lt;/p&gt;  &lt;p&gt;So I started loading the Italian keyboard layout and decided to use the ALT GR key as my &lt;em&gt;function&lt;/em&gt; key for my new key combinations: it’s easy to check which keys are already assigned and which are free:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/0216.image_5F00_2.png" target="_blank"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" class="wlDisabledImage" title="Italian standard keyboard layoout" border="0" alt="Italian standard keyboard layoout" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/5383.image_5F00_thumb.png" width="640" height="330" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Now just double-click a key on the keyboard to get this dialog:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/5086.image_5F00_4.png" target="_blank"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" class="wlDisabledImage" title="assign new key" border="0" alt="assign new key" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/4747.image_5F00_thumb_5F00_1.png" width="533" height="480" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Now just add the new key in the box with the corresponding control key combination (I chose CTRL+ALT+&amp;lt;key&amp;gt;) to assign it; after some quick tests I came up with the following layout which I’m using on all my machines now:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/2768.image_5F00_6.png" target="_blank"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" class="wlDisabledImage" title="custom keyboard layout" border="0" alt="custom keyboard layout" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/0143.image_5F00_thumb_5F00_2.png" width="640" height="330" /&gt;&lt;/a&gt;     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;From the &lt;em&gt;Project&lt;/em&gt; menu is possible to validate and test the new keyboard layout and also the &lt;em&gt;Build DLL and Setup Package&lt;/em&gt; that creates a MSI setup package to install the new keyboard. Once installed, the new keyboard can be enabled from the &lt;em&gt;Text Services and Input Languages&lt;/em&gt; dialog (click on &lt;em&gt;Change keyboard&lt;/em&gt; on &lt;em&gt;Region and Language&lt;/em&gt; dialog, &lt;em&gt;Keyboarda and Languages&lt;/em&gt; tab), choose your custom keyboard layout as the &lt;em&gt;Default input language:&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/2625.image_5F00_8.png" target="_blank"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" class="wlDisabledImage" title="input languages" border="0" alt="input languages" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/0564.image_5F00_thumb_5F00_3.png" width="385" height="480" /&gt;&lt;/a&gt;     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;Hope you’ll enjoy your new keyboard layout as I’m doing with mine &lt;img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-nerdsmile" alt="Nerd smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/3201.wlEmoticon_2D00_nerdsmile_5F00_2.png" /&gt;.&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Segoe Print"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Segoe Print"&gt;Carlo&lt;/font&gt;&lt;/a&gt;&lt;/p&gt; &lt;b&gt;&lt;i&gt;Quote of the day: &lt;/i&gt;&lt;/b&gt;Read, every day, something no one else is reading. Think, every day, something no one else is thinking. Do, every day, something no one else would be silly enough to do. It is bad for the mind to be always part of unanimity. - &lt;a href="http://en.wikipedia.org/wiki/Christopher_Morley" target="_blank"&gt;Christopher Morley&lt;/a&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10004098" width="1" height="1"&gt;</content><author><name>Carlo  Cardella</name><uri>http://blogs.msdn.com/carloc/ProfileUrlRedirect.ashx</uri></author><category term="Productivity" scheme="http://blogs.msdn.com/b/carloc/archive/tags/Productivity/" /><category term="Tools" scheme="http://blogs.msdn.com/b/carloc/archive/tags/Tools/" /></entry><entry><title>IDEVDataCollector source code available for download</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/carloc/archive/2010/03/13/idevdatacollector-source-code-available-for-download.aspx" /><id>http://blogs.msdn.com/b/carloc/archive/2010/03/13/idevdatacollector-source-code-available-for-download.aspx</id><published>2010-03-13T22:58:23Z</published><updated>2010-03-13T22:58:23Z</updated><content type="html">&lt;p&gt;Download it from the &lt;a href="http://blogs.msdn.com/carloc/pages/idevdatacollector.aspx" target="_blank"&gt;IDEVDataCollector&lt;/a&gt; page &lt;img class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://www.devdebug.members.winisp.net/images/msdnblog/IDEVDataCollectorsourcecodeavailableford_15042/wlEmoticonsmile.png" /&gt;.&lt;/p&gt;  &lt;p&gt;Don’t expect too sophisticated coding techniques (at least it gets the job done), let me know what you think, I’m open for suggestions and feature requests &lt;img class="wlEmoticon wlEmoticon-nerd" alt="Nerd" src="http://www.devdebug.members.winisp.net/images/msdnblog/IDEVDataCollectorsourcecodeavailableford_15042/wlEmoticonnerd.png" /&gt;.&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Segoe Print"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Segoe Print"&gt;Carlo&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;i&gt;Quote of the day: &lt;/i&gt;&lt;/b&gt;...when you have eliminated the impossible, whatever remains, however improbable, must be the truth. - &lt;a href="http://en.wikipedia.org/wiki/Sir_Arthur_Conan_Doyle" target="_blank"&gt;Sir Arthur Conan Doyle&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9978166" width="1" height="1"&gt;</content><author><name>Carlo  Cardella</name><uri>http://blogs.msdn.com/carloc/ProfileUrlRedirect.ashx</uri></author><category term="IDEVDataCollector" scheme="http://blogs.msdn.com/b/carloc/archive/tags/IDEVDataCollector/" /></entry><entry><title>IDEVDataCollector adds IIS6 support</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/carloc/archive/2010/03/09/idevdatacollector-adds-iis6-support.aspx" /><id>http://blogs.msdn.com/b/carloc/archive/2010/03/09/idevdatacollector-adds-iis6-support.aspx</id><published>2010-03-09T15:04:16Z</published><updated>2010-03-09T15:04:16Z</updated><content type="html">&lt;p&gt;It took me some time (mostly because of other demanding tasks and commitments I have for my daily job) but finally I have just updated IDEVDataCollector to support IIS 6, it’s available at the tool main page: &lt;a title="http://blogs.msdn.com/carloc/pages/idevdatacollector.aspx" href="http://blogs.msdn.com/carloc/pages/idevdatacollector.aspx" target="_blank"&gt;http://blogs.msdn.com/carloc/pages/idevdatacollector.aspx&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Give it a try and let me know what you think &lt;img class="wlEmoticon wlEmoticon-nerd" alt="Nerd" src="http://www.devdebug.members.winisp.net/images/msdnblog/IDEVDataCollectoraddsIIS6support_DF46/wlEmoticonnerd.png" /&gt;&lt;/p&gt;  &lt;p&gt;P.s.   &lt;br /&gt;Yes, I’m planning to release the source code too, stay tuned!&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Segoe Print"&gt;Carlo&lt;/font&gt;&lt;/a&gt;&lt;/p&gt; &lt;b&gt;&lt;i&gt;Quote of the day: &lt;/i&gt;&lt;/b&gt;  &lt;br /&gt;Clothes make the man. Naked people have little or no influence on society. - &lt;a href="http://en.wikipedia.org/wiki/Mark_Twain" target="_blank"&gt;Mark Twain&lt;/a&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9975490" width="1" height="1"&gt;</content><author><name>Carlo  Cardella</name><uri>http://blogs.msdn.com/carloc/ProfileUrlRedirect.ashx</uri></author><category term="ASP.NET" scheme="http://blogs.msdn.com/b/carloc/archive/tags/ASP-NET/" /><category term="IIS" scheme="http://blogs.msdn.com/b/carloc/archive/tags/IIS/" /><category term="Tools" scheme="http://blogs.msdn.com/b/carloc/archive/tags/Tools/" /><category term="Troubleshooting" scheme="http://blogs.msdn.com/b/carloc/archive/tags/Troubleshooting/" /><category term="IDEVDataCollector" scheme="http://blogs.msdn.com/b/carloc/archive/tags/IDEVDataCollector/" /></entry><entry><title>Which files to collect? Here’s a tool for you</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/carloc/archive/2010/02/01/which-files-to-collect-here-s-a-tool-for-you.aspx" /><id>http://blogs.msdn.com/b/carloc/archive/2010/02/01/which-files-to-collect-here-s-a-tool-for-you.aspx</id><published>2010-02-01T16:07:27Z</published><updated>2010-02-01T16:07:27Z</updated><content type="html">&lt;p&gt;Over the last couple of months among other things I’ve been working on a tool to automatically the logs and information in my team we usually ask at the beginning of a new Support Call: all &lt;em&gt;standard&lt;/em&gt; things such as IIS logs, event logs, .config files etc… Not all of those files are necessary for every case (as usual it depends on the problem at hand), but experience tells me the more information we have about the &lt;em&gt;environment&lt;/em&gt;, the more chances we have to spot small inconsistencies, configuration problems etc… that sometimes can lay unnoticed and interfere with our work. &lt;/p&gt;  &lt;p&gt;So, enter our guest:&lt;/p&gt;  &lt;h3&gt;IDevDataCollector&lt;/h3&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="IDevDataCollector" border="0" alt="IDevDataCollector" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/4174.image_5F00_3.png" width="400" height="353" /&gt; &lt;/p&gt;  &lt;p&gt;I tried to keep the UI as simple and organized as possible, utilization is very easy, just run it and click the “Collect” button, sit there a couple of minutes (how much exactly will depend on the logs collected) and you’re done &lt;img class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/3007.wlEmoticon_2D00_smile_5F00_2.png" /&gt;. Please note that I’m still working on it, this is just a &lt;em&gt;preview&lt;/em&gt; release but I’d love to have your feedback/bug reports/feature requests etc…, keeping in mind that the scope of this tool is to facilitate troubleshooting and data collection for IIS/ASP.NET related problems, I am not interested (and probably do not have the time) to build an omnicomprehensive tool to replace everything else we have today &lt;img class="wlEmoticon wlEmoticon-nerd" alt="Nerd" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/0755.wlEmoticon_2D00_nerd_5F00_2.png" /&gt;.&lt;/p&gt;  &lt;p&gt;So, here is the list of what it collects so far:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;IIS      &lt;ul&gt;       &lt;li&gt;IIS logs &lt;/li&gt;        &lt;li&gt;IIS configuration (content of C:\Windows\System32\Inetsrv\config for IIS 7, metabase.xml for IIS 6) &lt;/li&gt;        &lt;li&gt;HttpErr logs &lt;/li&gt;        &lt;li&gt;Freb logs (IIS 7 only) &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;ASP.NET      &lt;ul&gt;       &lt;li&gt;.config files and .browser files under .NET Framework installation folder(s): all versions available on the machine &lt;/li&gt;        &lt;li&gt;.config files for the sites/vdirs configured in IIS (the list of sites and applications is dynamically read from the config store) &lt;/li&gt;        &lt;li&gt;ASP.NET setup logs &lt;/li&gt;        &lt;li&gt;ACLs for the sites and applications defined in IIS (the list of sites and applications is dynamically read from the config store) &lt;/li&gt;        &lt;li&gt;Result from browsing get_aspx_version.aspx (the page does not exist, this is made on purpose to get the 404 error page from IIS) &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Event Logs      &lt;ul&gt;       &lt;li&gt;Application &lt;/li&gt;        &lt;li&gt;Security (not enabled by default) &lt;/li&gt;        &lt;li&gt;System &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Environment      &lt;ul&gt;       &lt;li&gt;System information (uses msinfo32.exe, might take a few minutes to complete) &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt;: it currently works only with IIS 7 (hence on Vista/Windows 7/Windows 2008 and Windows 2008 R2). &lt;/p&gt;  &lt;p&gt;Already on the “to do” list:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Enable Windows 2003 (IIS6) support &lt;/li&gt;    &lt;li&gt;Support IIS7 shared configuration &lt;/li&gt;    &lt;li&gt;Collect local policy information for the worker process account &lt;/li&gt;    &lt;li&gt;Collect custom event logs (in case one is used to store custom application messages) &lt;/li&gt;    &lt;li&gt;Improve performances and enhance application logging &lt;/li&gt;    &lt;li&gt;Implement a log report (such a summary HTML page or similar) for easy access and review to the collected information &lt;/li&gt;    &lt;li&gt;Automatically compress the collected logs for an easier transfer &lt;/li&gt;    &lt;li&gt;&lt;em&gt;Suggestions?&lt;/em&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The dedicated page is &lt;a title="http://blogs.msdn.com/carloc/pages/idevdatacollector.aspx" href="http://blogs.msdn.com/carloc/pages/idevdatacollector.aspx"&gt;http://blogs.msdn.com/carloc/pages/idevdatacollector.aspx&lt;/a&gt;, let me know what if think! &lt;img class="wlEmoticon wlEmoticon-wink" alt="Wink" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/7711.wlEmoticon_2D00_wink_5F00_2.png" /&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Segoe Print"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Segoe Print"&gt;Carlo&lt;/font&gt;&lt;/a&gt;&lt;/p&gt; &lt;b&gt;&lt;i&gt;Quote of the day: &lt;/i&gt;&lt;/b&gt;  &lt;br /&gt;In archaeology you uncover the unknown. In diplomacy you cover the known. - &lt;a href="http://en.wikipedia.org/wiki/Thomas_R._Pickering" target="_blank"&gt;Thomas Pickering&lt;/a&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9956362" width="1" height="1"&gt;</content><author><name>Carlo  Cardella</name><uri>http://blogs.msdn.com/carloc/ProfileUrlRedirect.ashx</uri></author><category term="ASP.NET" scheme="http://blogs.msdn.com/b/carloc/archive/tags/ASP-NET/" /><category term="IIS" scheme="http://blogs.msdn.com/b/carloc/archive/tags/IIS/" /><category term="Tools" scheme="http://blogs.msdn.com/b/carloc/archive/tags/Tools/" /><category term="Troubleshooting" scheme="http://blogs.msdn.com/b/carloc/archive/tags/Troubleshooting/" /><category term="IDEVDataCollector" scheme="http://blogs.msdn.com/b/carloc/archive/tags/IDEVDataCollector/" /></entry><entry><title>Internet Explorer wants to install Silverlight over and over and over again…</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/carloc/archive/2010/01/19/internet-explorer-wants-to-install-silverlight-over-and-over-and-over-again.aspx" /><id>http://blogs.msdn.com/b/carloc/archive/2010/01/19/internet-explorer-wants-to-install-silverlight-over-and-over-and-over-again.aspx</id><published>2010-01-19T15:33:00Z</published><updated>2010-01-19T15:33:00Z</updated><content type="html">&lt;p&gt;I just realized I have not posted anything here over the last couple of months which is definitely not a good thing to keep a blog alive… &lt;img class="wlEmoticon wlEmoticon-disappointedsmile" style="style" alt="Disappointed smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-05-metablogapi/8407.wlEmoticon_2D00_disappointedsmile_5F00_43EE31C5.png" /&gt; It’s been a busy period, I’ve been working on the &lt;a href="http://blogs.msdn.com/itasupport" target="_blank"&gt;Italian Developer Support Blog&lt;/a&gt; with my colleague &lt;a href="http://blogs.msdn.com/raffael" target="_blank"&gt;Raffaele&lt;/a&gt;, of course working with our customers on Support Cases, working on a few internal organizational changes (still in progress) and I’ve also been working on a tool to automatically collect logs and information about IIS, ASP.NET and the server itself we’ll (hopefully &lt;img class="wlEmoticon wlEmoticon-smile" style="style" alt="Smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-05-metablogapi/0552.wlEmoticon_2D00_smile_5F00_2366F213.png" /&gt;) use in our everyday work when troubleshooting customer’s problems.&lt;/p&gt;  &lt;p&gt;One of the toughest problems I worked on in this period was actually on my machine… for some reason I could no longer use &lt;a href="http://silverlight.net/" target="_blank"&gt;Silverlight&lt;/a&gt; on my office desktop, every time Internet Explorer proposed to install the component but either the setup failed with an error indicating that Silverlight was already installed on my machine (which it really was!) or some other error that inevitably lead to an aborted setup. This seemed to be a machine-wide setting (not just my account) because I got the same problem no matter which account I used to log-on to my machine.&lt;/p&gt;  &lt;p&gt;If you quickly need to get your Silverlight working you can do as I did: use the “Reset Internet Explorer Settings” button in the “Advanced” tab to restore some IE settings to their default RTM state; this will &lt;u&gt;not&lt;/u&gt; delete your personal data (cookies, forms, InPrivate filters, accelerators etc…) unless you explicitly flag the “Delete personal settings” checkbox:&lt;/p&gt;  &lt;p&gt;&lt;img title="" style="border: 0px currentcolor; display: inline; background-image: none;" border="0" alt="Reset Internet Explorer Settings" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-05-metablogapi/0167.image_5F00_09FEEED9.png" width="678" height="625" /&gt;&amp;#160; &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;Anyway I am curios and I managed to collect some data before and after the reset to compare and get the differences and identify which setting is causing the problem (of course I’ll post it when ready), I just wanted to save you and headache in case you have this same issue.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Segoe Print"&gt;Carlo&lt;/font&gt;&lt;/p&gt; &lt;b&gt;&lt;i&gt;Quote of the day: &lt;/i&gt;&lt;/b&gt;  &lt;br /&gt;In this world nothing can be said to be certain, except death and taxes. - &lt;a href="http://en.wikipedia.org/wiki/Benjamin_Franklin" target="_blank"&gt;Benjamin Franklin&lt;/a&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9950367" width="1" height="1"&gt;</content><author><name>Carlo  Cardella</name><uri>http://blogs.msdn.com/carloc/ProfileUrlRedirect.ashx</uri></author><category term="Internet Explorer" scheme="http://blogs.msdn.com/b/carloc/archive/tags/Internet+Explorer/" /><category term="Silverlight" scheme="http://blogs.msdn.com/b/carloc/archive/tags/Silverlight/" /></entry><entry><title>Missing ASP.NET Tab (this time on Windows 2000)</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/carloc/archive/2009/10/14/missing-asp-net-tab-this-time-on-windows-2000.aspx" /><id>http://blogs.msdn.com/b/carloc/archive/2009/10/14/missing-asp-net-tab-this-time-on-windows-2000.aspx</id><published>2009-10-14T14:00:27Z</published><updated>2009-10-14T14:00:27Z</updated><content type="html">&lt;p&gt;I already wrote a post on this matter &lt;a href="http://blogs.msdn.com/carloc/archive/2006/09/09/missing-asp-net-tab-in-iis-management-console.aspx" target="_blank"&gt;some time ago&lt;/a&gt;, but this week worked on the same problem on a Windows 2000 Server, of course 32 bit.&lt;/p&gt;  &lt;p&gt;Running &lt;em&gt;aspnet_regiis -i&lt;/em&gt; did not help so we tried to run the script &lt;a href="http://blogs.msdn.com/tom" target="_blank"&gt;Tom&lt;/a&gt; provides in his post, but we got the error here below:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="80070003" border="0" alt="80070003" src="http://blogs.msdn.com/blogfiles/carloc/WindowsLiveWriter/5084d6943cf7_CD3A/image_3.png" width="363" height="212" /&gt;&lt;/p&gt;  &lt;p&gt;Line 41 is “&lt;em&gt;Set objIIS = GetObject(&amp;quot;IIS://&amp;quot; &amp;amp; strComputer &amp;amp; &amp;quot;/W3SVC/AppPools&amp;quot;)&lt;/em&gt;”, this path does not exist in IIS 5 metabase, hence the error. To adapt it to IIS 5 we removed the script section that checks for &lt;a href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/5d306956-b2a2-4708-9bb9-72a395d474bb.mspx?mfr=true" target="_blank"&gt;Enable32BitAppOnWin64&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;We run the script again and got this message:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;i&gt;PASS: The current value of Restrict_Run is: 0        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;PASS: Successfully registered mmcaspext.dll        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;PASS: Successfully registered AspNetMMC        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Microsoft (R) .NET Framework Assembly Registration Utility 2.0.50727.1433        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Copyright (C) Microsoft Corporation 1998-2004.&amp;#160; All rights reserved.        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Types registered successfully        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Assembly exported to 'C:\WINNT\Microsoft.NET\Framework\v2.0.50727\AspNetMMCExt.tlb', and the type library was registered successfully        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;PASS: Successfully registered Assembly        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Running aspmantst.exe to test the ASP.NET Tab snap-in        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Attempting to create the object as CLSCTX_LOCAL_SERVER.        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;Create failed. hr: 80070005&lt;/font&gt;&lt;/strong&gt;. QIhr: 80070005. GLE: 1008         &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Attempting to create the object as CLSCTX_REMOTE_SERVER to &amp;lt;machine_name&amp;gt;.        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;Create failed. hr: 80070005&lt;/font&gt;&lt;/strong&gt;. QIhr: 80070005. GLE: 1008         &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Attempting to create the object as CLSCTX_INPROC_SERVER.        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Object created. Attempting to call method.        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Method succeded. Result: &lt;/i&gt;&lt;i&gt;1.1.4322.0,C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll,2.0.50727.0,C:\WINNT\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll&lt;/i&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Code 80070005 means “Access Denied”, so we do not have enough permission to complete the configuration… The object we are trying to create, which represents the ASP.NET Ta in IIS Manager, is listed in dcomcnfg as &lt;em&gt;Microsoft.Aspnet.Snapin.AspNetManagementUtility.2&lt;/em&gt;. In a default Windows 2000 SP4 installation, the Default Access Permission ACL is empty: when you log in as an administrator, if the ACL list is empty then the owner changes to whatever account you are logging on with: this account is the owner and implicitly has access to the COM instantiation works fine. But if the ACL list is not empty (it contains &lt;em&gt;any&lt;/em&gt; account or group) the owner does &lt;u&gt;not&lt;/u&gt; change at logon and the automatic mechanism just described does not work.&lt;/p&gt; &lt;a href="http://blogs.msdn.com/blogfiles/carloc/WindowsLiveWriter/5084d6943cf7_CD3A/image_7.png" target="_blank"&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="dcomcnfg applications" border="0" alt="dcomcnfg applications" src="http://blogs.msdn.com/blogfiles/carloc/WindowsLiveWriter/5084d6943cf7_CD3A/image_thumb_2.png" width="218" height="240" /&gt;&lt;/a&gt; &lt;a href="http://blogs.msdn.com/blogfiles/carloc/WindowsLiveWriter/5084d6943cf7_CD3A/image_9.png" target="_blank"&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="custom access permission" border="0" alt="custom access permission" src="http://blogs.msdn.com/blogfiles/carloc/WindowsLiveWriter/5084d6943cf7_CD3A/image_thumb_3.png" width="218" height="240" /&gt;&lt;/a&gt; &lt;a href="http://blogs.msdn.com/blogfiles/carloc/WindowsLiveWriter/5084d6943cf7_CD3A/clip_image001_2.jpg" target="_blank"&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="registry value permission" border="0" alt="registry value permission" src="http://blogs.msdn.com/blogfiles/carloc/WindowsLiveWriter/5084d6943cf7_CD3A/clip_image001_thumb.jpg" width="240" height="180" /&gt;&lt;/a&gt;   &lt;p&gt;Likely the same missing permission we were already facing, Microsoft.Aspnet.Snapin.AspNetManagementUtility.2 did not show up in our application list… so we add a look at the same kind of permission, but this time we checked the “Default Security” tab:&lt;/p&gt; &lt;a href="http://blogs.msdn.com/blogfiles/carloc/WindowsLiveWriter/5084d6943cf7_CD3A/image_11.png" target="_blank"&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="dcomcnfg default security" border="0" alt="dcomcnfg default security" src="http://blogs.msdn.com/blogfiles/carloc/WindowsLiveWriter/5084d6943cf7_CD3A/image_thumb_4.png" width="218" height="240" /&gt;&lt;/a&gt;   &lt;p&gt;And here we were! On another working machine this customer had the ACL list was empty, while for some reason on the failing machine the list was not empty, we had an account listed there… in such a situation there are two options:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Clear the ACL list &lt;/li&gt;    &lt;li&gt;Add the Administrators group and any other account you need to explicitly grand Access Permissions to &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;In our case we cleared the list, run the script again (this time every step completed successfully) and the customer got his ASP.NET Tab available in IIS Manager &lt;img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-nerdsmile" alt="Nerd smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/7343.wlEmoticon_2D00_nerdsmile_5F00_2.png" /&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Segoe Print"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Segoe Print"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Segoe Print"&gt;Carlo&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;i&gt;Quote of the day: &lt;/i&gt;&lt;/b&gt;    &lt;br /&gt;If you develop an ear for sounds that are musical it is like developing an ego. You begin to refuse sounds that are not musical and that way cut yourself off from a good deal of experience. - &lt;a href="http://en.wikipedia.org/wiki/John_Cage" target="_blank"&gt;John Cage&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9907147" width="1" height="1"&gt;</content><author><name>Carlo  Cardella</name><uri>http://blogs.msdn.com/carloc/ProfileUrlRedirect.ashx</uri></author><category term="ASP.NET" scheme="http://blogs.msdn.com/b/carloc/archive/tags/ASP-NET/" /><category term="IIS" scheme="http://blogs.msdn.com/b/carloc/archive/tags/IIS/" /></entry><entry><title>Input validation and another StackOverflow</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/carloc/archive/2009/10/06/net-runtime-2-0-error-event-id-1000.aspx" /><id>http://blogs.msdn.com/b/carloc/archive/2009/10/06/net-runtime-2-0-error-event-id-1000.aspx</id><published>2009-10-06T14:55:51Z</published><updated>2009-10-06T14:55:51Z</updated><content type="html">&lt;p&gt;Here’s another interesting crash problem I worked on a few days ago: the application pool was randomly crashing and the following errors were logged:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;i&gt;Event Type:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Error        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Event Source:&amp;#160;&amp;#160; .NET Runtime 2.0 Error Reporting        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Event Category: None        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Event ID:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1000        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Date:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 21/08/2009        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Time:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 12:23:12        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;User:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; N/A        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Computer:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;computername&amp;gt;        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Description: &lt;/i&gt;&lt;i&gt;Faulting application w3wp.exe, version 6.0.3790.3959, stamp 45d691cc, faulting module kernel32.dll, version 5.2.3790.4062, stamp 462643a7, debug? 0, fault address 0x0000000000027d8d.&lt;/i&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;i&gt;Event Type:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Warning        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Event Source:&amp;#160;&amp;#160; W3SVC        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Event Category:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; None        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Event ID:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1011        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Date:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 21/08/2009        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Time:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 12:23:14        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;User:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; N/A        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Computer:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;computername&amp;gt;        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Description: &lt;/i&gt;&lt;i&gt;A process serving application pool &amp;lt;AppPoolName&amp;gt; suffered a fatal communication error with the World Wide Web Publishing Service. The process id was xxx. The data field contains the error number. &lt;/i&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Even if with some difficulties (we had to disable Error Reporting as described &lt;a href="http://blogs.msdn.com/carloc/archive/2009/04/14/where-s-my-dump-gone.aspx" target="_blank"&gt;here&lt;/a&gt;) we managed to capture a coupe of dumps for this crash; dumping the exception was not very helpful:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;p&gt;0:027&amp;gt; !gle&lt;br /&gt;LastErrorValue: (Win32) 0x3f0 (1008) - An attempt was made to reference a token that does not exist.&lt;br /&gt;LastStatusValue: (NTSTATUS) 0xc000007c - An attempt was made to reference a token that doesn't exist.  This is typically done by referencing the token associated with a thread when the thread is not impersonating a client.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;0:027&amp;gt; !printexception&lt;br /&gt;There is no current managed exception on this thread&lt;/p&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;But dumping the very long stack gave some good hint at least about a potential problem (a stack overflow):&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;0:027&amp;gt; kpL&lt;br /&gt;Child-SP          RetAddr           Call Site&lt;br /&gt;00000000`05fcae90 00000642`7f895333 kernel32!RaiseException+0x73&lt;br /&gt;00000000`05fcaf60 00000642`78390730 mscorwks!`string'+0x81ef3&lt;br /&gt;00000000`05fcb130 00000642`780a9522 mscorlib_ni!System.OrdinalComparer.Equals(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x70&lt;br /&gt;00000000`05fcb170 00000642`7809822a mscorlib_ni!System.Collections.Hashtable.KeyEquals(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x42&lt;br /&gt;00000000`05fcb1a0 00000642`748f8976 mscorlib_ni!System.Collections.Hashtable.get_Item(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x15a&lt;br /&gt;00000000`05fcb260 00000642`748ff9bc System_ni!System.Collections.Specialized.NameObjectCollectionBase.FindEntry(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x16&lt;br /&gt;00000000`05fcb290 00000642`80580f48 System_ni!System.Collections.Specialized.NameValueCollection.Get(&amp;lt;HRESULT 0x80004001&amp;gt;)+0xc&lt;br /&gt;00000000`05fcb2c0 00000642`8058108d MyTest!MyClass.Web.Pages.BasePage.get_Language(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x48&lt;br /&gt;00000000`05fcb300 00000642`8058108d MyTest!MyClass.Web.Pages.BasePage.get_Language(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x18d&lt;br /&gt;00000000`05fcb340 00000642`8058108d MyTest!MyClass.Web.Pages.BasePage.get_Language(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x18d&lt;br /&gt;00000000`05fcb380 00000642`8058108d MyTest!MyClass.Web.Pages.BasePage.get_Language(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x18d&lt;br /&gt;00000000`05fcb3c0 00000642`8058108d MyTest!MyClass.Web.Pages.BasePage.get_Language(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x18d&lt;br /&gt;00000000`05fcb400 00000642`8058108d MyTest!MyClass.Web.Pages.BasePage.get_Language(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x18d&lt;br /&gt;00000000`05fcb440 00000642`8058108d MyTest!MyClass.Web.Pages.BasePage.get_Language(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x18d&lt;br /&gt;00000000`05fcb480 00000642`8058108d MyTest!MyClass.Web.Pages.BasePage.get_Language(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x18d&lt;br /&gt;00000000`05fcb4c0 00000642`8058108d MyTest!MyClass.Web.Pages.BasePage.get_Language(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x18d&lt;br /&gt;00000000`05fcb500 00000642`8058108d MyTest!MyClass.Web.Pages.BasePage.get_Language(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x18d&lt;br /&gt;00000000`05fcb540 00000642`8058108d MyTest!MyClass.Web.Pages.BasePage.get_Language(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x18d&lt;br /&gt;00000000`05fcb580 00000642`8058108d MyTest!MyClass.Web.Pages.BasePage.get_Language(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x18d&lt;br /&gt;00000000`05fcb5c0 00000642`8058108d MyTest!MyClass.Web.Pages.BasePage.get_Language(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x18d&lt;br /&gt;00000000`05fcb600 00000642`8058108d MyTest!MyClass.Web.Pages.BasePage.get_Language(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x18d&lt;br /&gt;00000000`05fcb640 00000642`8058108d MyTest!MyClass.Web.Pages.BasePage.get_Language(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x18d&lt;br /&gt;00000000`05fcb680 00000642`8058108d MyTest!MyClass.Web.Pages.BasePage.get_Language(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x18d&lt;br /&gt;00000000`05fcb6c0 00000642`8058108d MyTest!MyClass.Web.Pages.BasePage.get_Language(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x18d&lt;br /&gt;00000000`05fcb700 00000642`8058108d MyTest!MyClass.Web.Pages.BasePage.get_Language(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x18d&lt;br /&gt;00000000`05fcb740 00000642`8058108d MyTest!MyClass.Web.Pages.BasePage.get_Language(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x18d&lt;br /&gt;00000000`05fcb780 00000642`8058108d MyTest!MyClass.Web.Pages.BasePage.get_Language(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x18d&lt;br /&gt;00000000`05fcb7c0 00000642`8058108d MyTest!MyClass.Web.Pages.BasePage.get_Language(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x18d&lt;br /&gt;00000000`05fcb800 00000642`8058108d MyTest!MyClass.Web.Pages.BasePage.get_Language(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x18d&lt;br /&gt;00000000`05fcb840 00000642`8058108d MyTest!MyClass.Web.Pages.BasePage.get_Language(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x18d&lt;br /&gt;00000000`05fcb880 00000642`8058108d MyTest!MyClass.Web.Pages.BasePage.get_Language(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x18d&lt;br /&gt;00000000`05fcb8c0 00000642`8058108d MyTest!MyClass.Web.Pages.BasePage.get_Language(&amp;lt;HRESULT 0x80004001&amp;gt;)+0x18d&lt;br /&gt;[...]&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;Using the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=BE596899-7BB8-4208-B7FC-09E02A13696C&amp;amp;displaylang=en" target="_blank"&gt;err.exe&lt;/a&gt; utility to lookup the exit code of the process when it crashed, we can confirm we had a stack overflow: &lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;p&gt;Event Type:      Warning&lt;br /&gt;Event Source:    W3SVC&lt;br /&gt;Event Category:  None&lt;br /&gt;Event ID:        1009&lt;br /&gt;Date:            21/08/2009&lt;br /&gt;Time:            13:44:11&lt;br /&gt;User:            N/A&lt;br /&gt;Computer:        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;computername&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;Description: A process serving application pool &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;AppPoolName&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; terminated unexpectedly. &lt;br /&gt;            The process id was '5392'. The process exit code was '&lt;font color="#ff0000"&gt;&lt;strong&gt;0x800703e9&lt;/strong&gt;&lt;/font&gt;'.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C:\&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;err &lt;font color="#ff0000"&gt;&lt;strong&gt;0x800703e9&lt;/strong&gt;&lt;/font&gt;&lt;br /&gt;# for hex 0x800703e9 / decimal -2147023895&lt;br /&gt;  &lt;strong&gt;&lt;font color="#ff0000"&gt;COR_E_STACKOVERFLOW&lt;/font&gt;&lt;/strong&gt;                                            corerror.h&lt;br /&gt;# Is raised by the EE when the execution stack overflows as&lt;br /&gt;# it is attempting to ex&lt;br /&gt;# as an HRESULT: Severity: FAILURE (1), FACILITY_WIN32 (0x7), Code 0x3e9&lt;br /&gt;# for hex 0x3e9 / decimal 1001&lt;br /&gt;  &lt;strong&gt;&lt;font color="#ff0000"&gt;ERROR_STACK_OVERFLOW&lt;/font&gt;&lt;/strong&gt;                                           winerror.h&lt;br /&gt;# Recursion too deep; the stack overflowed.&lt;br /&gt;# 2 matches found for &amp;quot;0x800703e9&amp;quot;&lt;/p&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;In the IIS log the request that lead to the crash was like this:&lt;/p&gt;

&lt;p&gt;
  &lt;table border="0" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;
      &lt;tr&gt;
        &lt;td valign="bottom" width="69"&gt;
          &lt;p&gt;GET&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="1133"&gt;
          &lt;p&gt;/MyApp/test.aspx?currentPreferences=2&amp;amp;ParentId=1&amp;amp;ClientDateTime=Wed%20Aug%2019%202009%2009:09:57%20GMT+0100%20(GMT%20Standard%20Time)&amp;amp;TimeZone=-60&amp;amp;&lt;font color="#ff0000"&gt;&lt;strong&gt;Language=undefined&lt;/strong&gt;&lt;/font&gt;&amp;amp;Currency=undefined&amp;amp;OrgUnitId=undefined&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;&lt;/table&gt;
&lt;/p&gt;

&lt;p&gt;Basically some user was using a robot to scrape the web site and the &lt;em&gt;Language&lt;/em&gt; parameter (along with a few others) was not correctly set; in this case the customer’s code was not properly validating those parameters (using a browser they are always valid) and this cause the endless recursion that ultimately exhausted the stack.&lt;/p&gt;

&lt;p&gt;Needless to say, improving the parameter validation logic resolved the problem &lt;img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-nerdsmile" alt="Nerd smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/1805.wlEmoticon_2D00_nerdsmile_5F00_2.png" /&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000080" size="2" face="Segoe Print"&gt;Carlo&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;b&gt;&lt;i&gt;Quote of the day: &lt;/i&gt;&lt;/b&gt;

&lt;br /&gt;Seeing ourselves as others see us would probably confirm our worst suspicions about them. - &lt;a href="http://en.wikipedia.org/wiki/Franklin_P._Adams" target="_blank"&gt;Franklin P. Adams&lt;/a&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9903757" width="1" height="1"&gt;</content><author><name>Carlo  Cardella</name><uri>http://blogs.msdn.com/carloc/ProfileUrlRedirect.ashx</uri></author><category term="Debugging/Windbg" scheme="http://blogs.msdn.com/b/carloc/archive/tags/Debugging_2F00_Windbg/" /></entry><entry><title>New opening: Italian Dev Support blog</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/carloc/archive/2009/09/11/new-opening-italian-dev-support-blog.aspx" /><id>http://blogs.msdn.com/b/carloc/archive/2009/09/11/new-opening-italian-dev-support-blog.aspx</id><published>2009-09-11T07:20:32Z</published><updated>2009-09-11T07:20:32Z</updated><content type="html">&lt;p&gt;Yesterday my Italian colleagues in Developer Support and I officially inaugurated our new team blog: if you can read Italian then join us at &lt;a href="http://blogs.msdn.com/itasupport" target="_blank"&gt;http://blogs.msdn.com/itasupport&lt;/a&gt;&amp;#160;&lt;img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-nerdsmile" alt="Nerd smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/3364.wlEmoticon_2D00_nerdsmile_5F00_2.png" /&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Segoe Print"&gt;Carlo&lt;/font&gt;&lt;/a&gt;&lt;/p&gt; &lt;b&gt;&lt;i&gt;Quote of the day: &lt;/i&gt;&lt;/b&gt;  &lt;br /&gt;Everything that irritates us about others can lead us to an understanding of ourselves. - &lt;a href="http://en.wikipedia.org/wiki/Carl_Jung" target="_blank"&gt;Carl Jung&lt;/a&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9894057" width="1" height="1"&gt;</content><author><name>Carlo  Cardella</name><uri>http://blogs.msdn.com/carloc/ProfileUrlRedirect.ashx</uri></author><category term="Italian techs" scheme="http://blogs.msdn.com/b/carloc/archive/tags/Italian+techs/" /></entry><entry><title>Hosting on a UNC share is not supported for the Windows XP Platform</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/carloc/archive/2009/09/06/hosting-on-a-unc-share-is-not-supported-for-the-windows-xp-platform.aspx" /><id>http://blogs.msdn.com/b/carloc/archive/2009/09/06/hosting-on-a-unc-share-is-not-supported-for-the-windows-xp-platform.aspx</id><published>2009-09-06T12:43:16Z</published><updated>2009-09-06T12:43:16Z</updated><content type="html">&lt;p&gt;If you have a complex solution, with a lot of folders and subfolders, and you are hosting and debugging it on a remote IIS server (not on your local machine), you may get an error similar to the following:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;An error occurred loading a configuration file: Failed to start monitoring changes to '&amp;lt;path&amp;gt;' because the network BIOS command limit has been reached. For more information on this error, please refer to Microsoft knowledge base article 810886. Hosting on a UNC share is not supported for the Windows XP Platform&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The article mentioned in the error message (&lt;a title="http://support.microsoft.com/kb/810886/en-us" href="http://support.microsoft.com/kb/810886/en-us" target="_blank"&gt;810886&lt;/a&gt;) suggests to change the MaxCmds and MaxMpxCt values, but when I had the chance to work on this problem this solution does not always work (anyway I suggest you to give it a try before discarding it).&lt;/p&gt;  &lt;p&gt;You may find another message in your event log, like the following:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;i&gt;Event Type: Warning        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Event Source: Srv        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Event Category: None        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Event ID: 2021        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Date:        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Time:        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;User: N/A        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Computer:        &lt;br /&gt;&lt;/i&gt;&lt;i&gt;Description: The server was unable to allocate a work item x times in the last 60 seconds&lt;/i&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;If you do, give the article &lt;a title="http://support.microsoft.com/default.aspx?scid=kb;EN-US;317249" href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;317249" target="_blank"&gt;317249&lt;/a&gt; a try (increase the MaxWorkItems value).&lt;/p&gt;  &lt;p&gt;The solution I find most useful is the one described in &lt;a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;911272" target="_blank"&gt;911272&lt;/a&gt;: if your .NET build is at least 2.0.50727.&lt;font color="#ff0000"&gt;62&lt;/font&gt;&lt;font color="#000000"&gt; you already have the fix mentioned in the article but you may need to &lt;em&gt;activate&lt;/em&gt; it:&lt;/font&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;b&gt;&lt;em&gt;Registry information          &lt;br /&gt;&lt;/em&gt;&lt;/b&gt;&lt;em&gt;To enable this hotfix, you must add the following DWORD value at the following registry key:        &lt;br /&gt;&lt;/em&gt;&lt;em&gt;HKLM\Software\Microsoft\&lt;/em&gt;&lt;em&gt;ASP.NET&lt;/em&gt;&lt;em&gt;\FCNMode        &lt;br /&gt;&lt;/em&gt;&lt;em&gt;The following table lists possible values for the FCNMode DWORD value and the behavior that is associated with each value. &lt;/em&gt;&lt;/p&gt;    &lt;table border="0" cellspacing="2" cellpadding="2" width="834"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="130"&gt;Value&lt;/td&gt;          &lt;td valign="top" width="696"&gt;Behavior&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="130"&gt;Does not exist&lt;/td&gt;          &lt;td valign="top" width="696"&gt;This is the default behavior. For each subdirectory, the application will create an object that will monitor the subdirectory&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="130"&gt;0 or greater than 2&lt;/td&gt;          &lt;td valign="top" width="696"&gt;This is the default behavior. For each subdirectory, the application will create an object that will monitor the subdirectory&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="130"&gt;1&lt;/td&gt;          &lt;td valign="top" width="696"&gt;The application will disable File Change Notifications (FCNs)&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="130"&gt;2&lt;/td&gt;          &lt;td valign="top" width="696"&gt;The application will create one object to monitor the main directory. The application will use this object to monitor each subdirectory&lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/blockquote&gt;  &lt;p&gt;I suggest to set FCNMode to 2, so you’ll still have File Change Notifications in place.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Segoe Print"&gt;Carlo&lt;/font&gt;&lt;/p&gt; &lt;b&gt;&lt;i&gt;Quote of the day: &lt;/i&gt;&lt;/b&gt;  &lt;br /&gt;The greatest challenge to any thinker is stating the problem in a way that will allow a solution. - &lt;a href="http://en.wikipedia.org/wiki/Bertrand_Russell" target="_blank"&gt;Bertrand Russell&lt;/a&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9891911" width="1" height="1"&gt;</content><author><name>Carlo  Cardella</name><uri>http://blogs.msdn.com/carloc/ProfileUrlRedirect.ashx</uri></author><category term="Visual Studio" scheme="http://blogs.msdn.com/b/carloc/archive/tags/Visual+Studio/" /></entry><entry><title>An authentication error occurred while communicating with the web server</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/carloc/archive/2009/08/30/an-authentication-error-occurred-while-communicating-with-the-web-server.aspx" /><id>http://blogs.msdn.com/b/carloc/archive/2009/08/30/an-authentication-error-occurred-while-communicating-with-the-web-server.aspx</id><published>2009-08-30T20:25:20Z</published><updated>2009-08-30T20:25:20Z</updated><content type="html">&lt;p&gt;I’m back after the summer break (3 weeks spent trying to master the “Do It Yourself” art at home &lt;img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/4478.wlEmoticon_2D00_smile_5F00_2.png" /&gt;) and my second day in office I got an interesting problem with &lt;a href="http://blogs.msdn.com/carloc/archive/2006/09/30/sweet-sorrow-remote-debugging-and-more.aspx" target="_blank"&gt;remote debugging&lt;/a&gt;: after installing the Service Pack 2 for .NET 2.0, when trying to debug our web application (hosted on a remote IIS) we were getting the following error: “&lt;em&gt;Unable to start debugging on the web server. An authentication error occurred while communicating with the web server&lt;/em&gt;”. Note, you can get the same error if you install the Service Pack 1 for .NET 3.5: the reason is simple, if you install the SP1 for .NET 3.5 you’ll automatically get the SP2 for .NET 2.0. Another point: you are using host headers in your site.&lt;/p&gt;  &lt;p&gt;Anyway, the error is caused by a security change: in .NET 3.5 SP1 (and .NET 2.0 SP2) now defaults to specifying the host name used in the request URL in an SPN in the NTLM authentication package. The NTLM authentication process includes a challenge issued by the destination machine and sent back to the client machine. When Windows receives a challenge it generated itself, authentication will fail unless the connection is a loop back connection. When a Web Site is configured with a host header, the host name is neither the machine name nor the loop back IP address nor the machine's IP address, so the authentication request will fail.&lt;/p&gt;  &lt;p&gt;There are two possible solutions:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;The recommended approach is to map your host header name to the loop back address in the registry. Here are the steps:      &lt;ul&gt;       &lt;li&gt;Click Start &amp;gt; Run, type regedit and click OK &lt;/li&gt;        &lt;li&gt;In Registry Editor, select the registry key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0” &lt;/li&gt;        &lt;li&gt;Right-click MSV1_0 &amp;gt; New &amp;gt; Multi-String Value &lt;/li&gt;        &lt;li&gt;Type “BackConnectionHostNames” and press ENTER &lt;/li&gt;        &lt;li&gt;Right-click “BackConnectionHostNames” &amp;gt; Modify &lt;/li&gt;        &lt;li&gt;In the Value data box, type the host name or the host names for the sites that are on the local computer, then click OK &lt;/li&gt;        &lt;li&gt;Quit the Registry Editor and reset IIS &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;A less secure work around is to disable the loop back check, as described in &lt;a href="http://support.microsoft.com/kb/896861"&gt;http://support.microsoft.com/kb/896861&lt;/a&gt; &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;If you want more information on this matter you have have a look at &lt;a href="http://blogs.msdn.com/lukaszp/archive/2008/07/18/reporting-services-http-401-unauthorized-host-headers-require-your-attention.aspx" target="_blank"&gt;http://blogs.msdn.com/lukaszp/archive/2008/07/18/reporting-services-http-401-unauthorized-host-headers-require-your-attention.aspx&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Segoe Print"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Segoe Print"&gt;Carlo&lt;/font&gt;&lt;/a&gt;&lt;/p&gt; &lt;b&gt;&lt;i&gt;Quote of the day: &lt;/i&gt;&lt;/b&gt;  &lt;br /&gt;If fifty million people say a foolish thing, it is still a foolish thing. - &lt;a href="http://en.wikipedia.org/wiki/Anatole_France" target="_blank"&gt;Anatole France&lt;/a&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9889137" width="1" height="1"&gt;</content><author><name>Carlo  Cardella</name><uri>http://blogs.msdn.com/carloc/ProfileUrlRedirect.ashx</uri></author><category term="Visual Studio" scheme="http://blogs.msdn.com/b/carloc/archive/tags/Visual+Studio/" /></entry><entry><title>Security advisory bulletin 973882 (July 28, 2009)</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/carloc/archive/2009/07/29/security-advisory-bulletin-973882-july-28-2009.aspx" /><id>http://blogs.msdn.com/b/carloc/archive/2009/07/29/security-advisory-bulletin-973882-july-28-2009.aspx</id><published>2009-07-29T09:40:04Z</published><updated>2009-07-29T09:40:04Z</updated><content type="html">&lt;p&gt;My colleague &lt;a href="http://blogs.technet.com/feliciano_intini/" target="_blank"&gt;Feliciano&lt;/a&gt; has just made me aware of an extraordinary security bulletin we have just released for a new vulnerability discovered in ATL libraries which could allow remote code execution; here are the information I am aware of so far:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.microsoft.com/technet/security/advisory/973882.mspx" target="_blank"&gt;Microsoft Security Advisory (973882)&lt;/a&gt; &lt;em&gt;English&lt;/em&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.technet.com/feliciano_intini/archive/2009/07/28/rilascio-straordinario-di-sicurezza-microsoft-del-28-luglio-2009-prime-indicazioni-e-raccomandazioni.aspx"&gt;Rilascio straordinario di sicurezza Microsoft del 28 luglio 2009: prime indicazioni e raccomandazioni&lt;/a&gt;&amp;#160;&lt;em&gt;(Feliciano’s post, if you can read Italian)&lt;/em&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The updates to install:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.microsoft.com/technet/security/bulletin/ms09-034.mspx" target="_blank"&gt;MS09-034&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.microsoft.com/technet/security/bulletin/ms09-035.mspx" target="_blank"&gt;MS09-035&lt;/a&gt;&amp;#160;&lt;em&gt;(for developers, update for Visual Studio)&lt;/em&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Segoe Print"&gt;Carlo&lt;/font&gt;&lt;/a&gt;&lt;/p&gt; &lt;b&gt;&lt;i&gt;Quote of the day: &lt;/i&gt;&lt;/b&gt;  &lt;br /&gt;Those who dream by day are cognizant of many things which escape those who dream only by night. - &lt;a href="http://en.wikipedia.org/wiki/Edgar_Allan_Poe" target="_blank"&gt;Edgar Allan Poe&lt;/a&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9851774" width="1" height="1"&gt;</content><author><name>Carlo  Cardella</name><uri>http://blogs.msdn.com/carloc/ProfileUrlRedirect.ashx</uri></author><category term="Hotfix/Service Pack" scheme="http://blogs.msdn.com/b/carloc/archive/tags/Hotfix_2F00_Service+Pack/" /></entry><entry><title>ASP.NET 1.1 not configurable in IIS Manager?</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/carloc/archive/2009/07/28/asp-net-1-1-not-configurable-in-iis-manager.aspx" /><id>http://blogs.msdn.com/b/carloc/archive/2009/07/28/asp-net-1-1-not-configurable-in-iis-manager.aspx</id><published>2009-07-28T13:26:44Z</published><updated>2009-07-28T13:26:44Z</updated><content type="html">&lt;p&gt;If you search the Internet you’ll likely find a good number of articles and blog posts about how to configure ASP.NET 1.1 on IIS 7, here are a couple of good examples:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://learn.iis.net/page.aspx/472/how-to-install-aspnet-11-with-iis7-on-vista-and-windows-2008/" target="_blank"&gt;How to install ASP.NET 1.1 with IIS7 on Vista and Windows 2008&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.iis.net/wonyoo/archive/2009/06/18/workaround-running-asp-net-1-1-on-vista-sp2-ws08-sp2.aspx" target="_blank"&gt;Workaround: Running ASP.NET 1.1 on Vista SP2/WS08 SP2&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://forums.iis.net/t/1150725.aspx?PageIndex=1" target="_blank"&gt;Thread: Running ASP.NET 1.1 with Windows 2008 64 bit and IIS 7.0&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Something I have not found written elsewhere is why it is not possible configure ASP.NET properties from the IIS Manager interface? Even if you correctly configure the application pool (32 bit, Classic pipeline), use the workaround to avoid the error on &lt;a href="http://learn.iis.net/page.aspx/124/introduction-to-applicationhostconfig/" target="_blank"&gt;applicationHost.config&lt;/a&gt;, add the &lt;a href="http://msdn.microsoft.com/en-us/library/system.configuration.ignoresectionhandler.aspx" target="_blank"&gt;IgnoreSectionHandler&lt;/a&gt; to avoid ASP.NET 1.1 runtime exceptions due to the not recognized IIS 7 configuration tags and finally the ASP.NET 1.1 pages works fine and are served correctly, you’ll not have the “ASP.NET” icon group in IIS Manager:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-05-metablogapi/3652.image_5F00_2AC3E9A7.png" target="_blank"&gt;&lt;img title="" style="border: 0px currentcolor; display: inline; background-image: none;" border="0" alt="Missing &amp;quot;ASP.NET&amp;quot; tab" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-05-metablogapi/7652.image_5F00_thumb_5F00_638E1DA7.png" width="640" height="434" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;As you can imagine, if you move the application to an application pool where you are running ASP.NET 2.0, the icon group appears where you expect it to be: &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-05-metablogapi/6232.image_5F00_3_5F00_7CA21188.png" target="_blank"&gt;&lt;img title="" style="border: 0px currentcolor; display: inline; background-image: none;" border="0" alt="With &amp;quot;ASP.NET&amp;quot; Tab" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-05-metablogapi/3187.image_5F00_3_5F00_thumb_5F00_35D8787E.png" width="640" height="434" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Well, it turns out that ASP.NET 1.1 configuration is not supported by InetMgr.exe (the IIS Manager), you have to use &lt;a href="http://learn.iis.net/page.aspx/114/getting-started-with-appcmdexe" target="_blank"&gt;appcmd.exe&lt;/a&gt; using &lt;em&gt;/commit:machine&lt;/em&gt; (for &lt;a href="http://msdn.microsoft.com/en-us/library/ms229697.aspx" target="_blank"&gt;machine.config&lt;/a&gt;) or &lt;em&gt;/commit:webroot&lt;/em&gt; (for the root web.config) to check if the changes work and they end up where they are supposed to. Note, there are some limitations because of the lack of a complete schema; if you feel brave enough you can create your own custom schema, I do not think (this is my opinion, I do not have an official work on this) that Microsoft will provide such schema. Or if you are even braver you can edit the .config files directly in Notepad, but this sounds like business for real geeks… how much geek do you feel? &lt;img class="wlEmoticon wlEmoticon-nerdsmile" style="style" alt="Nerd smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/8080.wlEmoticon_2D00_nerdsmile_5F00_2.png" /&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Segoe Print"&gt;Carlo&lt;/font&gt;&lt;/p&gt; &lt;b&gt;&lt;i&gt;Quote of the day: &lt;/i&gt;&lt;/b&gt;  &lt;br /&gt;The belief in a supernatural source of evil is not necessary; men alone are quite capable of every wickedness. - &lt;a href="http://en.wikipedia.org/wiki/Joseph_Conrad" target="_blank"&gt;Joseph Conrad&lt;/a&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9851017" width="1" height="1"&gt;</content><author><name>Carlo  Cardella</name><uri>http://blogs.msdn.com/carloc/ProfileUrlRedirect.ashx</uri></author><category term="ASP.NET" scheme="http://blogs.msdn.com/b/carloc/archive/tags/ASP-NET/" /><category term="IIS" scheme="http://blogs.msdn.com/b/carloc/archive/tags/IIS/" /></entry><entry><title>Thread exit may kill your Session</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/carloc/archive/2009/07/24/thread-exit-may-kill-your-session.aspx" /><id>http://blogs.msdn.com/b/carloc/archive/2009/07/24/thread-exit-may-kill-your-session.aspx</id><published>2009-07-24T14:38:58Z</published><updated>2009-07-24T14:38:58Z</updated><content type="html">&lt;p&gt;Every now and then we got a call for an application which, randomly and without a specific pattern or apparent reason, shuts down all user’s sessions. Since ASP.NET 2.0 we can use &lt;a href="http://blogs.msdn.com/carloc/archive/2007/03/10/watch-out-your-web-events.aspx" target="_blank"&gt;Web Events&lt;/a&gt; to have more information on what is happening at the runtime level and this time the message we had in the event log was pretty clear:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Event code: 1002        &lt;br /&gt;Event message: &lt;font color="#ff0000"&gt;Application is shutting down. Reason: Configuration changed.&lt;/font&gt;         &lt;br /&gt;Event time:&amp;#160; &lt;br /&gt;Event time (UTC):         &lt;br /&gt;Event ID:&amp;#160; &lt;br /&gt;Event sequence:         &lt;br /&gt;Event occurrence: 1         &lt;br /&gt;Event detail code:&amp;#160; &lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;Application information:        &lt;br /&gt;Application domain: /LM/W3SVC/1045621189/Root-2-1742334186915428         &lt;br /&gt;Trust level: Full         &lt;br /&gt;Application Virtual Path: /         &lt;br /&gt;Application Path: C:\Inetpub\wwwroot\         &lt;br /&gt;Machine name: &amp;lt;machinename&amp;gt; &lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;Process information:        &lt;br /&gt;Process ID: 1234         &lt;br /&gt;Process name: w3wp.exe         &lt;br /&gt;Account name: NT AUTHORITY\NETWORK SERVICE &lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;We used &lt;a href="http://www.microsoft.com/technet/sysinternals/utilities/processmonitor.mspx" target="_blank"&gt;Process Monitor&lt;/a&gt; to track access to the relevant .config files which are usually the cause for this kind of problem, but with no luck.&lt;/p&gt;  &lt;p&gt;To make a long story short, we had a look at the events around the time when the session was lost and we noticed it usually followed some exception tracking logic the customer had used, so we had a look at the source code and found something interesting: the customer had some code to write and maintain a custom log on a text file and this work was done on a background thread. This code was using the &lt;a href="http://msdn.microsoft.com/en-us/library/system.configuration.configurationmanager.aspx" target="_blank"&gt;ConfigurationManager&lt;/a&gt; class to read some settings from the web.config.&lt;/p&gt;  &lt;p&gt;Now the interesting part: the background thread was executed in a different AppDomain than the ASP.NET application and it needed to initialize this new AppDomain to use the ConfigurationManager; as part of this initialization we create a new &lt;em&gt;File Change Notification&lt;/em&gt; object to monitor &lt;a href="http://msdn.microsoft.com/en-us/library/ms229697.aspx" target="_blank"&gt;machine.config&lt;/a&gt; and web.config files for changes. When the background thread exited after his job was done, the File Change Notification object encountered this error:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;0x800703E3 ( -2147023901 ) = ERROR_OPERATION_ABORTED        &lt;br /&gt;&lt;/em&gt;&lt;em&gt;The I/O operation has been aborted because of either a thread exit or an application request&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Note, that is not an exception; but this &lt;em&gt;change notification&lt;/em&gt; event was “head” by all ASP.NET applications which is the expected behavior, and all AppDomains were restarted: the end users were therefore redirected to the login page &lt;img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-nerdsmile" alt="Nerd smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/6505.wlEmoticon_2D00_nerdsmile_5F00_2.png" /&gt;.&lt;/p&gt;  &lt;p&gt;How do you avoid this situation? Well, we made a small change to the exception handling code to not use ConfigurationManager in the background thread.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Segoe Print"&gt;Carlo&lt;/font&gt;&lt;/a&gt;&lt;/p&gt; &lt;b&gt;&lt;i&gt;Quote of the day: &lt;/i&gt;&lt;/b&gt;  &lt;br /&gt;When a person can no longer laugh at himself, it is time for others to laugh at him. - &lt;a href="http://en.wikipedia.org/wiki/Thomas_Szasz" target="_blank"&gt;Thomas Szasz&lt;/a&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9847627" width="1" height="1"&gt;</content><author><name>Carlo  Cardella</name><uri>http://blogs.msdn.com/carloc/ProfileUrlRedirect.ashx</uri></author><category term="ASP.NET" scheme="http://blogs.msdn.com/b/carloc/archive/tags/ASP-NET/" /><category term="CLR" scheme="http://blogs.msdn.com/b/carloc/archive/tags/CLR/" /></entry><entry><title>StackOverflow continued: DataSource or DataSourceID?</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/carloc/archive/2009/07/23/stackoverflow-continued-datasource-or-datasourceid.aspx" /><id>http://blogs.msdn.com/b/carloc/archive/2009/07/23/stackoverflow-continued-datasource-or-datasourceid.aspx</id><published>2009-07-23T16:49:26Z</published><updated>2009-07-23T16:49:26Z</updated><content type="html">&lt;p&gt;I have already wrote &lt;a href="http://blogs.msdn.com/carloc/archive/2009/04/27/stackoverflowexception-and-databind.aspx" target="_blank"&gt;here&lt;/a&gt; about a StackOverflowException I recently came across; after a while I got another quite similar problem, still a StackOverflowException with a very long recursion.&lt;/p&gt;  &lt;p&gt;Thread 36 is the one where the exception was thrown:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;0:000&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; !threads&lt;br /&gt;ThreadCount: 21&lt;br /&gt;UnstartedThread: 0&lt;br /&gt;BackgroundThread: 21&lt;br /&gt;PendingThread: 0&lt;br /&gt;DeadThread: 0&lt;br /&gt;Hosted Runtime: no&lt;br /&gt;                                      PreEmptive   GC Alloc           Lock&lt;br /&gt;       ID OSID ThreadOBJ    State     GC       Context       Domain   Count APT Exception&lt;br /&gt;  17    1  950 000f2580   1808220 Enabled  00000000:00000000 000eed48     0 MTA (Threadpool Worker)&lt;br /&gt;  27    2 1bfc 00100018      b220 Enabled  00000000:00000000 000eed48     0 MTA (Finalizer)&lt;br /&gt;  28    3  300 00117068    80a220 Enabled  00000000:00000000 000eed48     0 MTA (Threadpool Completion Port)&lt;br /&gt;  29    4 1cf4 0011a458      1220 Enabled  00000000:00000000 000eed48     0 Ukn&lt;br /&gt;   9    5  ec0 001702e0       220 Enabled  00000000:00000000 000eed48     0 Ukn&lt;br /&gt;  31    6 2414 00171f68   180b220 Enabled  00000000:00000000 000eed48     0 MTA (Threadpool Worker)&lt;br /&gt;  32    7 1f24 00172338   180b220 Enabled  00000000:00000000 000eed48     0 MTA (Threadpool Worker)&lt;br /&gt;  33    8  97c 001729e0   180b220 Enabled  00000000:00000000 000eed48     0 MTA (Threadpool Worker)&lt;br /&gt;  34    9 13bc 00173088   180b220 Enabled  00000000:00000000 000eed48     0 MTA (Threadpool Worker)&lt;br /&gt;  35    a 22f8 00173a50   180b220 Enabled  00000000:00000000 000eed48     0 MTA (Threadpool Worker)&lt;br /&gt;  &lt;font color="#ff0000"&gt;36    b 1e60 00174540   180b220 Disabled 12445a64:124475b8 0011ab48     1 MTA (Threadpool Worker) System.StackOverflowException (1a0a00a4)&lt;/font&gt;&lt;br /&gt;  37    c 1c8c 00174cf8   180b220 Enabled  00000000:00000000 000eed48     0 MTA (Threadpool Worker)&lt;br /&gt;  15    d 1934 0017d040   880a220 Enabled  00000000:00000000 000eed48     0 MTA (Threadpool Completion Port)&lt;br /&gt;   7    e 2028 0017ece8       220 Enabled  00000000:00000000 000eed48     0 Ukn&lt;br /&gt;   8    f  dbc 0016f280       220 Enabled  00000000:00000000 000eed48     0 Ukn&lt;br /&gt;   4   10 2298 05007008       220 Enabled  00000000:00000000 000eed48     0 Ukn&lt;br /&gt;   6   11 20c0 05004278       220 Enabled  00000000:00000000 000eed48     0 Ukn&lt;br /&gt;   3   12  c9c 05003b70       220 Enabled  00000000:00000000 000eed48     0 Ukn&lt;br /&gt;   5   13 1a84 04ff7a60       220 Enabled  00000000:00000000 000eed48     0 Ukn&lt;br /&gt;   2   14 253c 0d378ee0       220 Enabled  00000000:00000000 000eed48     0 Ukn&lt;br /&gt;  42   15 1760 0d38b3d8       220 Enabled  00000000:00000000 000eed48     0 Ukn&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;Again, here is the managed stack of the thread:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;0:036&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; !clrstack&lt;br /&gt;OS Thread Id: 0x1e60 (36)&lt;br /&gt;ESP       EIP     &lt;br /&gt;04e94acc 77e42004 [FaultingExceptionFrame: 04e94acc] &lt;br /&gt;04e95058 77e42004 [HelperMethodFrame: 04e95058] &lt;br /&gt;04e950c4 65230cc1 System.Data.RBTree`1+TreePage[[System.__Canon, mscorlib]]..ctor(Int32)&lt;br /&gt;04e950d4 65230abe System.Data.RBTree`1[[System.__Canon, mscorlib]].AllocPage(Int32)&lt;br /&gt;04e950f8 652309fc System.Data.RBTree`1[[System.__Canon, mscorlib]].InitTree()&lt;br /&gt;04e95108 65230961 System.Data.DataRowCollection..ctor(System.Data.DataTable)&lt;br /&gt;04e95118 652307c2 System.Data.DataTable..ctor()&lt;br /&gt;04e95134 65230535 System.Data.Common.DataTableMapping.GetDataTableBySchemaAction(System.Data.DataSet, System.Data.MissingSchemaAction)&lt;br /&gt;04e95150 6523037c System.Data.ProviderBase.SchemaMapping..ctor(System.Data.Common.DataAdapter, System.Data.DataSet, System.Data.DataTable, System.Data.ProviderBase.DataReaderContainer, Boolean, System.Data.SchemaType, System.String, Boolean, System.Data.DataColumn, System.Object)&lt;br /&gt;04e9519c 6522fbac System.Data.Common.DataAdapter.FillMappingInternal(System.Data.DataSet, System.Data.DataTable, System.String, System.Data.ProviderBase.DataReaderContainer, Int32, System.Data.DataColumn, System.Object)&lt;br /&gt;04e951d0 6522fc1e System.Data.Common.DataAdapter.FillMapping(System.Data.DataSet, System.Data.DataTable, System.String, System.Data.ProviderBase.DataReaderContainer, Int32, System.Data.DataColumn, System.Object)&lt;br /&gt;04e95218 6522f9e6 System.Data.Common.DataAdapter.FillFromReader(System.Data.DataSet, System.Data.DataTable, System.String, System.Data.ProviderBase.DataReaderContainer, Int32, Int32, System.Data.DataColumn, System.Object)&lt;br /&gt;04e95270 6522f942 System.Data.Common.DataAdapter.Fill(System.Data.DataSet, System.String, System.Data.IDataReader, Int32, Int32)&lt;br /&gt;04e952b4 65230105 System.Data.Common.DbDataAdapter.FillInternal(System.Data.DataSet, System.Data.DataTable[], Int32, Int32, System.String, System.Data.IDbCommand, System.Data.CommandBehavior)&lt;br /&gt;04e9530c 65230010 System.Data.Common.DbDataAdapter.Fill(System.Data.DataSet, Int32, Int32, System.String, System.Data.IDbCommand, System.Data.CommandBehavior)&lt;br /&gt;04e95350 6559401d System.Data.Common.DbDataAdapter.Fill(System.Data.DataSet, System.String)&lt;br /&gt;04e95384 6678d11f System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(System.Web.UI.DataSourceSelectArguments)&lt;br /&gt;04e95424 6668f498 System.Web.UI.DataSourceView.Select(System.Web.UI.DataSourceSelectArguments, System.Web.UI.DataSourceViewSelectCallback)&lt;br /&gt;04e95434 66792c0f System.Web.UI.WebControls.DataBoundControl.PerformSelect()&lt;br /&gt;04e9544c 6679285e System.Web.UI.WebControls.BaseDataBoundControl.DataBind()&lt;br /&gt;04e95458 667dcf35 System.Web.UI.WebControls.GridView.DataBind()&lt;br /&gt;04e9545c 660e1ac3 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound()&lt;br /&gt;04e95488 668ecdcd System.Web.UI.WebControls.BaseDataBoundControl.set_RequiresDataBinding(Boolean)&lt;br /&gt;04e95498 667da23b System.Web.UI.WebControls.&lt;font color="#ff0000"&gt;GridView.set_PageIndex&lt;/font&gt;(Int32)&lt;br /&gt;04e954a8 0ad3e096 ASP.search_aspx.&lt;font color="#ff0000"&gt;Gridview1_DataBound&lt;/font&gt;(System.Object, System.EventArgs)&lt;br /&gt;04e959a8 667928ce System.Web.UI.WebControls.BaseDataBoundControl.OnDataBound(System.EventArgs)&lt;br /&gt;04e959bc 66792b45 System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(System.Collections.IEnumerable)&lt;br /&gt;04e959cc 6668f4a4 System.Web.UI.DataSourceView.Select(System.Web.UI.DataSourceSelectArguments, System.Web.UI.DataSourceViewSelectCallback)&lt;br /&gt;04e959dc 66792c0f System.Web.UI.WebControls.DataBoundControl.PerformSelect()&lt;br /&gt;04e959f4 6679285e System.Web.UI.WebControls.BaseDataBoundControl.DataBind()&lt;br /&gt;04e95a00 667dcf35 System.Web.UI.WebControls.GridView.DataBind()&lt;br /&gt;04e95a04 660e1ac3 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound()&lt;br /&gt;04e95a30 668ecdcd System.Web.UI.WebControls.BaseDataBoundControl.set_RequiresDataBinding(Boolean)&lt;br /&gt;04e95a40 667da23b System.Web.UI.WebControls.&lt;font color="#ff0000"&gt;GridView.set_PageIndex&lt;/font&gt;(Int32)&lt;br /&gt;04e95a50 0ad3e096 ASP.search_aspx.&lt;font color="#ff0000"&gt;Gridview1_DataBound&lt;/font&gt;(System.Object, System.EventArgs)&lt;br /&gt;04e95f50 667928ce System.Web.UI.WebControls.BaseDataBoundControl.OnDataBound(System.EventArgs)&lt;br /&gt;04e95f64 66792b45 System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(System.Collections.IEnumerable)&lt;br /&gt;04e95f74 6668f4a4 System.Web.UI.DataSourceView.Select(System.Web.UI.DataSourceSelectArguments, System.Web.UI.DataSourceViewSelectCallback)&lt;br /&gt;04e95f84 66792c0f System.Web.UI.WebControls.DataBoundControl.PerformSelect()&lt;br /&gt;04e95f9c 6679285e System.Web.UI.WebControls.BaseDataBoundControl.DataBind()&lt;br /&gt;04e95fa8 667dcf35 System.Web.UI.WebControls.GridView.DataBind()&lt;br /&gt;04e95fac 660e1ac3 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound()&lt;br /&gt;04e95fd8 668ecdcd System.Web.UI.WebControls.BaseDataBoundControl.set_RequiresDataBinding(Boolean)&lt;br /&gt;04e95fe8 667da23b System.Web.UI.WebControls.&lt;font color="#ff0000"&gt;GridView.set_PageIndex&lt;/font&gt;(Int32)&lt;br /&gt;04e95ff8 0ad3e096 ASP.search_aspx.&lt;font color="#ff0000"&gt;Gridview1_DataBound&lt;/font&gt;(System.Object, System.EventArgs)&lt;br /&gt;&lt;br /&gt;[...]&lt;br /&gt;04ebea70 0ad3e096 ASP.search_aspx.Gridview1_DataBound(System.Object, System.EventArgs)&lt;br /&gt;04ebef70 667928ce System.Web.UI.WebControls.BaseDataBoundControl.OnDataBound(System.EventArgs)&lt;br /&gt;04ebef84 66792b45 System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(System.Collections.IEnumerable)&lt;br /&gt;04ebef94 6668f4a4 System.Web.UI.DataSourceView.Select(System.Web.UI.DataSourceSelectArguments, System.Web.UI.DataSourceViewSelectCallback)&lt;br /&gt;04ebefa4 66792c0f System.Web.UI.WebControls.DataBoundControl.PerformSelect()&lt;br /&gt;04ebefbc 6679285e System.Web.UI.WebControls.BaseDataBoundControl.DataBind()&lt;br /&gt;04ebefc8 667dcf35 System.Web.UI.WebControls.GridView.DataBind()&lt;br /&gt;04ebefcc 660e1ac3 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound()&lt;br /&gt;04ebeff8 660e1a57 System.Web.UI.WebControls.BaseDataBoundControl.OnPreRender(System.EventArgs)&lt;br /&gt;04ebf008 667e07da System.Web.UI.WebControls.GridView.OnPreRender(System.EventArgs)&lt;br /&gt;04ebf030 660abc21 System.Web.UI.Control.PreRenderRecursiveInternal()&lt;br /&gt;04ebf048 660abc7c System.Web.UI.Control.PreRenderRecursiveInternal()&lt;br /&gt;04ebf060 660abc7c System.Web.UI.Control.PreRenderRecursiveInternal()&lt;br /&gt;04ebf078 660abc7c System.Web.UI.Control.PreRenderRecursiveInternal()&lt;br /&gt;04ebf090 660abc7c System.Web.UI.Control.PreRenderRecursiveInternal()&lt;br /&gt;04ebf0a8 660a7c4b System.Web.UI.Page.ProcessRequestMain(Boolean, Boolean)&lt;br /&gt;04ebf200 660a77a4 System.Web.UI.Page.ProcessRequest(Boolean, Boolean)&lt;br /&gt;04ebf238 660a76d1 System.Web.UI.Page.ProcessRequest()&lt;br /&gt;04ebf270 660a7666 System.Web.UI.Page.ProcessRequestWithNoAssert(System.Web.HttpContext)&lt;br /&gt;04ebf27c 660a7642 System.Web.UI.Page.ProcessRequest(System.Web.HttpContext)&lt;br /&gt;04ebf290 0ad37afe ASP.search_aspx.ProcessRequest(System.Web.HttpContext)&lt;br /&gt;04ebf2a0 660adb16 System.Web.HttpApplication+CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()&lt;br /&gt;04ebf2d4 6608132c System.Web.HttpApplication.ExecuteStep(IExecutionStep, Boolean ByRef)&lt;br /&gt;04ebf314 6608c5c3 System.Web.HttpApplication+ApplicationStepManager.ResumeSteps(System.Exception)&lt;br /&gt;04ebf364 660808ac System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(System.Web.HttpContext, System.AsyncCallback, System.Object)&lt;br /&gt;04ebf380 66083e1c System.Web.HttpRuntime.ProcessRequestInternal(System.Web.HttpWorkerRequest)&lt;br /&gt;04ebf3b4 66083ac3 System.Web.HttpRuntime.ProcessRequestNoDemand(System.Web.HttpWorkerRequest)&lt;br /&gt;04ebf3c4 66082c5c System.Web.Hosting.ISAPIRuntime.ProcessRequest(IntPtr, Int32)&lt;br /&gt;04ebf5d8 79f68cde [ContextTransitionFrame: 04ebf5d8] &lt;br /&gt;04ebf60c 79f68cde [GCFrame: 04ebf60c] &lt;br /&gt;04ebf768 79f68cde [ComMethodFrame: 04ebf768] &lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;After the &lt;em&gt;DataBound&lt;/em&gt; event hander is executed, we always call &lt;em&gt;set_PageIndex&lt;/em&gt; and go through the binding logic over and over. What does it mean?&lt;/p&gt;

&lt;p&gt;Well, either use &lt;a href="http://www.aisto.com/roeder/dotnet/" target="_blank"&gt;Reflector&lt;/a&gt; or download the &lt;a href="http://blogs.msdn.com/sburke/archive/2008/01/16/configuring-visual-studio-to-debug-net-framework-source-code.aspx" target="_blank"&gt;.NET Framework source&lt;/a&gt; (or the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=8C09FD61-3F26-4555-AE17-3121B4F51D4D&amp;amp;displaylang=en" target="_blank"&gt;SSCLI&lt;/a&gt;, Shared Source Common Language Infrastructure), if you have a look at the implementation of set_PageIndex you’ll see something like this:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;virtual&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; set_PageIndex(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;value&lt;/span&gt; &amp;lt; 0)&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;throw&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ArgumentOutOfRangeException(&lt;span style="color: #006080"&gt;&amp;quot;value&amp;quot;&lt;/span&gt;);&lt;br /&gt;    }&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.PageIndex != &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;)&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._pageIndex = &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;base&lt;/span&gt;.Initialized)&lt;br /&gt;        {&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;.&lt;font color="#ff0000"&gt;RequiresDataBinding&lt;/font&gt; = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;Going deeper we see this:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; RequiresDataBinding()&lt;br /&gt;{&lt;br /&gt;    get&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._requiresDataBinding;&lt;br /&gt;    }&lt;br /&gt;    set&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (((&lt;span style="color: #0000ff"&gt;value&lt;/span&gt; &amp;amp;&amp;amp; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._preRendered) &amp;amp;&amp;amp; ((&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.DataSourceID.Length &amp;gt; 0) &amp;amp;&amp;amp; (&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Page != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;))) &amp;amp;&amp;amp; !&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Page.IsCallback)&lt;br /&gt;        {&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._requiresDataBinding = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.&lt;font color="#ff0000"&gt;EnsureDataBound&lt;/font&gt;();&lt;br /&gt;        }&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;&lt;br /&gt;        {&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._requiresDataBinding = &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;virtual&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; EnsureDataBound()&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._throwOnDataPropertyChange = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.RequiresDataBinding &amp;amp;&amp;amp; ((&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.DataSourceID.Length &amp;gt; 0) || &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._requiresBindToNull))&lt;br /&gt;        {&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.&lt;font color="#ff0000"&gt;DataBind&lt;/font&gt;();&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._requiresBindToNull = &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;finally&lt;/span&gt;&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._throwOnDataPropertyChange = &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;Here is the source code of the faulting page:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt; Gridview1_DataBound(&lt;span style="color: #0000ff"&gt;ByVal&lt;/span&gt; sender &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Object&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;ByVal&lt;/span&gt; e &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; EventArgs)&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;Try&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;If&lt;/span&gt; GridView1.Rows.Count &amp;gt; 0 &lt;span style="color: #0000ff"&gt;Then&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; pagerRow &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; GridViewRow = GridView1.BottomPagerRow&lt;br /&gt;                &lt;br /&gt;            [...]&lt;br /&gt;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; CurrentPage &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;String&lt;/span&gt;&lt;br /&gt;     &lt;br /&gt;            &lt;span style="color: #0000ff"&gt;If&lt;/span&gt; Request.QueryString(&lt;span style="color: #006080"&gt;&amp;quot;page&amp;quot;&lt;/span&gt;) &amp;lt;&amp;gt; &lt;span style="color: #006080"&gt;&amp;quot;&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Then&lt;/span&gt;&lt;br /&gt;                CurrentPage = Request.QueryString(&lt;span style="color: #006080"&gt;&amp;quot;page&amp;quot;&lt;/span&gt;)&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;Else&lt;/span&gt;&lt;br /&gt;                CurrentPage = 1&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;If&lt;/span&gt;&lt;br /&gt;    &lt;br /&gt;            &lt;span style="color: #0000ff"&gt;Try&lt;/span&gt;&lt;br /&gt;                &lt;font color="#ff0000"&gt;GridView1.PageIndex = CurrentPage - 1&lt;/font&gt;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;Catch&lt;/span&gt;&lt;br /&gt;                CurrentPage = 1&lt;br /&gt;                &lt;font color="#ff0000"&gt;GridView1.PageIndex = CurrentPage - 1&lt;/font&gt;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Try&lt;/span&gt;&lt;br /&gt;    &lt;br /&gt;            [...]  &lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Try&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;End&lt;/span&gt; Sub&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;So, if we change the PageIndex value, under some circumstances we call the DataBind method, the OnDataBound event is fired, the DataBound event hander is executed, PageIndex is changed again and so on until the stack is exhausted.&lt;/p&gt;

&lt;p&gt;Bottom line here is: do not change the PageIndex value inside the DataBound event handler!&lt;/p&gt;

&lt;h3&gt;DataSource or DataSourceID?&lt;/h3&gt;

&lt;p&gt;One of the conditions to implicitly call DataBind() is to have a value set for DataSourceID:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; RequiresDataBinding()&lt;br /&gt;{    &lt;br /&gt;    get    &lt;br /&gt;    {        &lt;br /&gt;        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._requiresDataBinding;    &lt;br /&gt;    }    &lt;br /&gt;    set    &lt;br /&gt;    {        &lt;br /&gt;        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (((&lt;span style="color: #0000ff"&gt;value&lt;/span&gt; &amp;amp;&amp;amp; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._preRendered) &amp;amp;&amp;amp; ((&lt;font color="#ff0000"&gt;&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.DataSourceID.Length &amp;gt; 0&lt;/font&gt;) &amp;amp;&amp;amp; (&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Page != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;))) &amp;amp;&amp;amp; !&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Page.IsCallback)            &lt;br /&gt;        {            &lt;br /&gt;            &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._requiresDataBinding = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;            &lt;br /&gt;            &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.EnsureDataBound();        &lt;br /&gt;        }        &lt;br /&gt;        &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;        &lt;br /&gt;        {            &lt;br /&gt;            &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._requiresDataBinding = &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;;        &lt;br /&gt;        }    &lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;Honestly I have not tried it (I’ll do and update the post if needed), but I think if we use DataSource rather than DataSourceID we’ll not incur in this problem.&lt;/p&gt;

&lt;p&gt;&lt;font color="#000080" size="2" face="Segoe Print"&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000080" size="2" face="Segoe Print"&gt;Carlo&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;b&gt;&lt;i&gt;Quote of the day: &lt;/i&gt;&lt;/b&gt;

&lt;br /&gt;There is nothing more dreadful than imagination without taste. - &lt;a href="http://en.wikipedia.org/wiki/Johann_Wolfgang_Von_Goethe" target="_blank"&gt;Johann Wolfgang von Goethe&lt;/a&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9846326" width="1" height="1"&gt;</content><author><name>Carlo  Cardella</name><uri>http://blogs.msdn.com/carloc/ProfileUrlRedirect.ashx</uri></author><category term="ASP.NET" scheme="http://blogs.msdn.com/b/carloc/archive/tags/ASP-NET/" /></entry><entry><title>SharePoint and Office Live? Access forbidden!</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/carloc/archive/2009/07/06/sharepoint-and-office-live-access-forbidden.aspx" /><id>http://blogs.msdn.com/b/carloc/archive/2009/07/06/sharepoint-and-office-live-access-forbidden.aspx</id><published>2009-07-06T22:50:21Z</published><updated>2009-07-06T22:50:21Z</updated><content type="html">&lt;p&gt;I recently came across an odd problem the customer got on his SharePoint server: when the clients had the Office Live add-on installed they were constantly refused with a &lt;a href="http://support.microsoft.com/kb/318380" target="_blank"&gt;403 error&lt;/a&gt;. The problem is well described &lt;a href="http://www.imason.com/blogs/bob_brown/archive/2009/06/13/sharepoint-fba-and-the-403-forbidden-error.aspx" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;If you have this problem, there is a fix for you: &lt;a title="default.aspx" href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;970946" target="_blank"&gt;970946&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;If you do not want to install the fix, you might consider to filter the UserAgent string you receive on the server (well, you should filter it &lt;em&gt;before&lt;/em&gt; the web request is processed on the server) as one of my customers is testing: if the UserAgent string contains the word “Mozilla” &lt;em&gt;and&lt;/em&gt; “Office”* &lt;em&gt;or&lt;/em&gt; “non-browser” &lt;em&gt;or&lt;/em&gt; “FrontPage”*, just remove the unwanted token. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Segoe Print"&gt;Carlo&lt;/font&gt;&lt;/a&gt;&lt;/p&gt; &lt;b&gt;&lt;i&gt;Quote of the day: &lt;/i&gt;&lt;/b&gt;  &lt;br /&gt;All things are difficult before they are easy. - &lt;a href="http://en.wikipedia.org/wiki/Thomas_Fuller_(writer)" target="_blank"&gt;Thomas Fuller&lt;/a&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9820493" width="1" height="1"&gt;</content><author><name>Carlo  Cardella</name><uri>http://blogs.msdn.com/carloc/ProfileUrlRedirect.ashx</uri></author><category term="Hotfix/Service Pack" scheme="http://blogs.msdn.com/b/carloc/archive/tags/Hotfix_2F00_Service+Pack/" /></entry><entry><title>Three errors, one cause: me!</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/carloc/archive/2009/06/03/three-errors-one-cause-me.aspx" /><id>http://blogs.msdn.com/b/carloc/archive/2009/06/03/three-errors-one-cause-me.aspx</id><published>2009-06-03T14:29:17Z</published><updated>2009-06-03T14:29:17Z</updated><content type="html">&lt;p&gt;A few days ago I was working on a repro I got from a customer as I very often do, and for some reason after a while my IIS started to behave oddly, pages where not served, the application pool was stuck doing “something” and whenever I tried to open the IIS Manager I got the error “There was an error when trying to connect. Do you want to retype your credentials and try again? Cannot create a file when that file already exists”: &lt;/p&gt;  &lt;p&gt;&lt;img title="" style="border: 0px currentcolor; display: inline; background-image: none;" border="0" alt="Failed to connect" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-05-metablogapi/1768.image_5F00_60B8CCA5.png" width="528" height="274" /&gt;&lt;/p&gt;  &lt;p&gt;Needless to say that being IIS on my local machine and I have not made any changes to the security/ACLs/DCOM etc… there should be no need to retype my credentials; and by the way, even retyping them did not help.&lt;/p&gt;  &lt;p&gt;By the way, if I tried to remotely connect to another machine of mine, I got the message “The type initializer for ‘Microsoft.Web.Management.Remoting.HttpChannel’ threw an exception”: &lt;/p&gt;  &lt;p&gt;&lt;img title="" style="border: 0px currentcolor; display: inline; background-image: none;" border="0" alt="Type initializer throw an exception" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-05-metablogapi/3835.image_5F00_5E9BCDDC.png" width="487" height="214" /&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;My next step has been to try to restart the World Wide Web Publishing Service: it was (oddly?) stopped, but again I got an error “Windows could not start the World Wide Web Publishing Service service on Local Computer. Error 1068: The dependency service or group failed to start”:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;img title="" style="border: 0px currentcolor; display: inline; background-image: none;" border="0" alt="The dependency service or group failed to start" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-05-metablogapi/8206.image_5F00_3D3C2840.png" width="494" height="231" /&gt;&lt;/p&gt;  &lt;p&gt;The W3SVC service has a dependency on &lt;a href="http://technet.microsoft.com/en-us/library/cc735229(WS.10).aspx" target="_blank"&gt;WAS&lt;/a&gt; (Windows Process Activation Service), I tried to start it manually and got “Windows could not start the Windows Process Activation Service service on Local Computer. Error 183: Cannot create a file when that file already exists.”: &lt;/p&gt;  &lt;p&gt;&lt;img title="" style="border: 0px currentcolor; display: inline; background-image: none;" border="0" alt="Could not start the WAS service" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-05-metablogapi/4087.image_5F00_1BDC82A4.png" width="494" height="229" /&gt; &lt;/p&gt;  &lt;p&gt;That is the same message I got from IIS Manager, so I thought to have a look at the event log to find out more: I was wrong! I got “MMC could not create the snap-in. The snap-in might not have been installed correctly”: &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-05-metablogapi/4503.image_5F00_7E872AD9.png" target="_blank"&gt;&lt;img title="" style="border: 0px currentcolor; display: inline; background-image: none;" border="0" alt="MMS coult not create the snap-in" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-05-metablogapi/8371.image_5F00_thumb_5F00_71ACD4BB.png" width="640" height="467" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I quickly found out that virtually every MMC snap-in was broken on my machine (“Server Manager” “Certificates”, “Local Users and Groups”, just name one) but why?!?&amp;#160; &lt;img class="wlEmoticon wlEmoticon-surprisedsmile" alt="Surprised smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/0842.wlEmoticon_2D00_surprisedsmile_5F00_2.png" /&gt;&lt;/p&gt;  &lt;p&gt;Well… on Windows 2008, MMC is based on .NET as of course is IIS and when the problem first appeared I was tampering my machine.config file to try different ThreadPool settings… &lt;img class="wlEmoticon wlEmoticon-thinkingsmile" alt="Thinking smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/8765.wlEmoticon_2D00_thinkingsmile_5F00_2.png" /&gt;&lt;/p&gt;  &lt;p&gt;The golden rule in computing reads “Always back-up sensitive data!”… after restoring my clean machine.config all the problems above went away! &lt;img class="wlEmoticon wlEmoticon-nerdsmile" alt="Nerd smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/6523.wlEmoticon_2D00_nerdsmile_5F00_2.png" /&gt;&lt;/p&gt;  &lt;p&gt;For curiosity I had a deeper look at it and found the following lines:&lt;/p&gt;  &lt;div id="codeSnippetWrapper" style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: &amp;quot;consolas&amp;quot;; font-size: 8pt; cursor: text; direction: ltr; background-color: rgb(244, 244, 244);"&gt;   &lt;pre id="codeSnippet" style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;consolas&amp;quot;; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;system.web&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;processModel&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;autoConfig&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;processModel&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;autoConfig&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;minWorkerThreads&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=&amp;quot;100&amp;quot;&lt;/span&gt; &lt;br /&gt;            &lt;span style="color: rgb(255, 0, 0);"&gt;minIoThreads&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=&amp;quot;100&amp;quot;&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;maxWorkerThreads&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=&amp;quot;404&amp;quot;&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;maxIoThreads&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=&amp;quot;404&amp;quot;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;httpRuntime&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;minFreeThreads&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=&amp;quot;152&amp;quot;&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;minLocalRequestFreeThreads&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=&amp;quot;152&amp;quot;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[...]&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;Easy to spot it now, eh? For my repro I had set autoConfig=”false” but then I decided to set it to “true”, for some reason I added a new &lt;a href="http://msdn.microsoft.com/en-us/library/7w2sway1.aspx" target="_blank"&gt;&amp;lt;processModel&amp;gt;&lt;/a&gt; element with its own autoConfig=”true” and forgot to remove the “old” &amp;lt;processModel&amp;gt;… At least I learnt something new from my foolishness! &lt;img class="wlEmoticon wlEmoticon-embarrassedsmile" alt="Embarrassed smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/5226.wlEmoticon_2D00_embarrassedsmile_5F00_2.png" /&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: there might be other reasons if you get the errors above, but always keep a clean backup of your configuration files at hand, just in case…&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000080" size="3" face="Brush Script MT"&gt;Carlo&lt;/font&gt;&lt;/p&gt;
&lt;b&gt;&lt;i&gt;Quote of the day: &lt;/i&gt;&lt;/b&gt;

&lt;br /&gt;We are continually faced with a series of great opportunities brilliantly disguised as insoluble problems. - &lt;a href="http://en.wikipedia.org/wiki/John_W._Gardner" target="_blank"&gt;John W. Gardner&lt;/a&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9691390" width="1" height="1"&gt;</content><author><name>Carlo  Cardella</name><uri>http://blogs.msdn.com/carloc/ProfileUrlRedirect.ashx</uri></author><category term="IIS" scheme="http://blogs.msdn.com/b/carloc/archive/tags/IIS/" /><category term="Vista/Longhorn" scheme="http://blogs.msdn.com/b/carloc/archive/tags/Vista_2F00_Longhorn/" /></entry><entry><title>Logparser automated within Windbg</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/carloc/archive/2009/05/08/logparser-automated-within-windbg.aspx" /><id>http://blogs.msdn.com/b/carloc/archive/2009/05/08/logparser-automated-within-windbg.aspx</id><published>2009-05-08T19:50:12Z</published><updated>2009-05-08T19:50:12Z</updated><content type="html">&lt;p&gt;The &lt;em&gt;.shell&lt;/em&gt; command in &lt;a href="http://www.microsoft.com/whdc/devtools/debugging/default.mspx" target="_blank"&gt;Windbg&lt;/a&gt; allows to pipe the output of a debugger command to an external process and automatically print its output back inside the debugger window; a useful example is the command FIND, for example if we want to parse the stack for every thread and find every call where the word “isapi” is involved:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;0:036&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;strong&gt;&lt;font color="#ff0000"&gt;.shell -ci &amp;quot;~*kpL1000&amp;quot; find /i &amp;quot;isapi&amp;quot;&lt;/font&gt;&lt;/strong&gt;&lt;br /&gt;013cff78 1004f94e ISAPI_Rewrite!TerminateFilter+0x3cef&lt;br /&gt;013cffb0 1004f9f3 ISAPI_Rewrite!TerminateFilter+0x4462e&lt;br /&gt;013cffec 00000000 ISAPI_Rewrite!TerminateFilter+0x446d3&lt;br /&gt;0144ff78 1004f94e ISAPI_Rewrite+0x7763&lt;br /&gt;0144ffb0 1004f9f3 ISAPI_Rewrite!TerminateFilter+0x4462e&lt;br /&gt;0144ffec 00000000 ISAPI_Rewrite!TerminateFilter+0x446d3&lt;br /&gt;.shell: Process exited&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;Incidentally also &lt;a href="http://forums.iis.net/default.aspx?GroupID=51" target="_blank"&gt;LogParser&lt;/a&gt; (one of my favorite debugging tools) can accept data to be parsed from the input stream using the STDIN keyword, so for example refactoring a script I posted &lt;a href="http://blogs.msdn.com/carloc/archive/2007/08/31/start-to-play-with-logparser.aspx" target="_blank"&gt;some time ago&lt;/a&gt; we can find out if there are any duplicated assemblies in our application pool that should be moved to the &lt;a href="http://msdn.microsoft.com/en-us/library/yf1d93sz.aspx" target="_blank"&gt;GAC&lt;/a&gt;:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;0:000&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; .shell -ci &amp;quot;!peb&amp;quot; logparser &amp;quot;select extract_filename(text) as Duplicated_Assemblies, count(Duplicated_Assemblies) as Hits from STDIN where index_of(text, 'temporary asp.net files') &lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; 0 group by Duplicated_Assemblies having count(Duplicated_Assemblies) &lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; 1&amp;quot; -i:textline -o:nat -rtp:-1&lt;br /&gt;Duplicated_Assemblies        Hits &lt;br /&gt;---------------------------- ----&lt;br /&gt;errormanager.dll             2&lt;br /&gt;winformsui.dll               2&lt;br /&gt;externallibraryinterface.dll 2&lt;br /&gt;ptshopengine.dll             2&lt;br /&gt;schemas.dll                  2&lt;br /&gt;dbengine.dll                 2&lt;br /&gt;flowservice.dll              2&lt;br /&gt;&lt;br /&gt;Statistics:&lt;br /&gt;-----------&lt;br /&gt;Elements processed: 182&lt;br /&gt;Elements output:    7&lt;br /&gt;Execution time:     0.02 seconds&lt;br /&gt;&lt;br /&gt;.shell: Process exited&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Following the same principle, we can find out if there are strong named assemblies in our /bin folder as follows:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;p&gt;0:000&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; .shell -ci &amp;quot;!dumpdomain&amp;quot; find /i &amp;quot;&lt;strong&gt;&lt;font color="#0000ff"&gt;shared domain&lt;/font&gt;&lt;/strong&gt;&amp;quot;&lt;br /&gt;Shared Domain: &lt;font color="#ff0000"&gt;&lt;strong&gt;0x793f2aa8&lt;/strong&gt;&lt;/font&gt;&lt;br /&gt;.shell: Process exited&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;0:000&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; .shell -ci &amp;quot;!dumpdomain &lt;font color="#ff0000"&gt;&lt;strong&gt;0x793f2aa8&lt;/strong&gt;&lt;/font&gt;&amp;quot; logparser &amp;quot;SELECT DISTINCT EXTRACT_FILENAME(text) as Strong_Named_Assemblies_In_/bin FROM STDIN WHERE INDEX_OF(to_lowercase(text), 'temporary asp.net files') &lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; 0&amp;quot; -i:TEXTLINE -o:NAT -RTP:-1&lt;br /&gt;Strong_Named_Assemblies_In_/bin &lt;br /&gt;-----------------------------------------&lt;br /&gt;crypto.dll&lt;br /&gt;radplaceholder.dll&lt;br /&gt;scms.dll&lt;br /&gt;sqldac.dll&lt;br /&gt;scontrollibrary.dll&lt;br /&gt;spell.dll&lt;br /&gt;editor.dll&lt;br /&gt;scms.resources.dll&lt;br /&gt;&lt;br /&gt;Statistics:&lt;br /&gt;-----------&lt;br /&gt;Elements processed: 164&lt;br /&gt;Elements output:    8&lt;br /&gt;Execution time:     0.01 seconds&lt;br /&gt;&lt;br /&gt;.shell: Process exited&lt;br /&gt;&lt;/p&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Instead of typing the whole command you can save it in a text file and execute it directly within Windbg with a command like “$&amp;gt;&amp;lt;c:\debuggers\snassemblies.txt”.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000080" size="3" face="Brush Script MT"&gt;Carlo&lt;/font&gt;&lt;/p&gt;
&lt;b&gt;&lt;i&gt;Quote of the day: &lt;/i&gt;&lt;/b&gt;

&lt;br /&gt;Setting a good example for children takes all the fun out of middle age. - &lt;a href="http://en.wikipedia.org/wiki/William_Feather" target="_blank"&gt;William Feather&lt;/a&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9597291" width="1" height="1"&gt;</content><author><name>Carlo  Cardella</name><uri>http://blogs.msdn.com/carloc/ProfileUrlRedirect.ashx</uri></author><category term="Debugging/Windbg" scheme="http://blogs.msdn.com/b/carloc/archive/tags/Debugging_2F00_Windbg/" /><category term="LogParser" scheme="http://blogs.msdn.com/b/carloc/archive/tags/LogParser/" /></entry><entry><title>StackOverflowException and DataBind()</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/carloc/archive/2009/04/27/stackoverflowexception-and-databind.aspx" /><id>http://blogs.msdn.com/b/carloc/archive/2009/04/27/stackoverflowexception-and-databind.aspx</id><published>2009-04-27T20:05:07Z</published><updated>2009-04-27T20:05:07Z</updated><content type="html">&lt;p&gt;The application pool for this site was getting disabled quite frequently and we found quite a few entries like the following in the event log:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Event Type: Error        &lt;br /&gt;Event Source: W3SVC         &lt;br /&gt;Event Category: None         &lt;br /&gt;Event ID: 1002         &lt;br /&gt;Date: 19/11/2008         &lt;br /&gt;Time: 15:20:23         &lt;br /&gt;User: N/A         &lt;br /&gt;Computer: &amp;lt;computername&amp;gt;         &lt;br /&gt;Description: Application pool 'DefaultAppPool' is being automatically disabled due to a series of failures in the process(es) serving that application pool&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;In this case the customer already had some debugging skills so when he called CSS he already had a few dumps available to analyze; they were some &lt;em&gt;process shutdown&lt;/em&gt; dumps (taken on Kernel32!TerminateProcess), strangely we had no &lt;em&gt;second chance&lt;/em&gt; dumps (maybe because of one of &lt;a href="http://blogs.msdn.com/carloc/archive/2009/04/14/where-s-my-dump-gone.aspx" target="_blank"&gt;these reasons&lt;/a&gt;?) but they’ve been a good point to start from anyway.&lt;/p&gt;  &lt;p&gt;First, let’s have a look at the exceptions:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;consolas&amp;#39;; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;consolas&amp;#39;; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;0:000&amp;gt; !dumpheap -type Exception -stat &lt;br /&gt;&lt;br /&gt;[...]&lt;br /&gt;&lt;br /&gt;Statistics:&lt;br /&gt;      MT    Count    TotalSize Class Name&lt;br /&gt;79333ed4        1           12 System.Text.DecoderExceptionFallback&lt;br /&gt;79333e90        1           12 System.Text.EncoderExceptionFallback&lt;br /&gt;79330d44        1           72 System.ExecutionEngineException&lt;br /&gt;79330cb4        1           72 System.StackOverflowException&lt;br /&gt;79330c24        1           72 System.OutOfMemoryException&lt;br /&gt;7931ffd4        1           72 System.NullReferenceException&lt;br /&gt;6610c7fc        1           84 System.Web.HttpUnhandledException&lt;br /&gt;79330dd4        2          144 System.Threading.ThreadAbortException&lt;br /&gt;79318afc        2          144 System.InvalidOperationException&lt;br /&gt;7931740c        5          160 System.UnhandledExceptionEventHandler&lt;br /&gt;Total 16 objects&lt;br /&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;Remember, a few special exceptions are loaded when the AppDomain is first created (see &lt;a href="http://blogs.msdn.com/carloc/archive/2007/08/04/i-have-an-outofmemory-exception-in-my-dump-am-i-leaking-memory.aspx" target="_blank"&gt;here&lt;/a&gt;) so let’s try to see if there is still something significant on the threads:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;consolas&amp;#39;; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;consolas&amp;#39;; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;0:000&amp;gt; !threads&lt;br /&gt;ThreadCount: 21&lt;br /&gt;UnstartedThread: 0&lt;br /&gt;BackgroundThread: 21&lt;br /&gt;PendingThread: 0&lt;br /&gt;DeadThread: 0&lt;br /&gt;Hosted Runtime: no&lt;br /&gt;                                      PreEmptive   GC Alloc           Lock&lt;br /&gt;       ID OSID ThreadOBJ    State     GC       Context       Domain   Count APT Exception&lt;br /&gt;  17    1  950 000f2580   1808220 Enabled  00000000:00000000 000eed48     0 MTA (Threadpool Worker)&lt;br /&gt;  27    2 1bfc 00100018      b220 Enabled  00000000:00000000 000eed48     0 MTA (Finalizer)&lt;br /&gt;  28    3  300 00117068    80a220 Enabled  00000000:00000000 000eed48     0 MTA (Threadpool Completion Port)&lt;br /&gt;  29    4 1cf4 0011a458      1220 Enabled  00000000:00000000 000eed48     0 Ukn&lt;br /&gt;   9    5  ec0 001702e0       220 Enabled  00000000:00000000 000eed48     0 Ukn&lt;br /&gt;  31    6 2414 00171f68   180b220 Enabled  00000000:00000000 000eed48     0 MTA (Threadpool Worker)&lt;br /&gt;  32    7 1f24 00172338   180b220 Enabled  00000000:00000000 000eed48     0 MTA (Threadpool Worker)&lt;br /&gt;  33    8  97c 001729e0   180b220 Enabled  00000000:00000000 000eed48     0 MTA (Threadpool Worker)&lt;br /&gt;  34    9 13bc 00173088   180b220 Enabled  00000000:00000000 000eed48     0 MTA (Threadpool Worker)&lt;br /&gt;  35    a 22f8 00173a50   180b220 Enabled  00000000:00000000 000eed48     0 MTA (Threadpool Worker)&lt;br /&gt;  36    b 1e60 00174540   180b220 Disabled 12445a64:124475b8 0011ab48     1 MTA (Threadpool Worker) &lt;font color="#ff0000"&gt;System.StackOverflowException&lt;/font&gt; (1a0a00a4)&lt;br /&gt;  37    c 1c8c 00174cf8   180b220 Enabled  00000000:00000000 000eed48     0 MTA (Threadpool Worker)&lt;br /&gt;  15    d 1934 0017d040   880a220 Enabled  00000000:00000000 000eed48     0 MTA (Threadpool Completion Port)&lt;br /&gt;   7    e 2028 0017ece8       220 Enabled  00000000:00000000 000eed48     0 Ukn&lt;br /&gt;   8    f  dbc 0016f280       220 Enabled  00000000:00000000 000eed48     0 Ukn&lt;br /&gt;   4   10 2298 05007008       220 Enabled  00000000:00000000 000eed48     0 Ukn&lt;br /&gt;   6   11 20c0 05004278       220 Enabled  00000000:00000000 000eed48     0 Ukn&lt;br /&gt;   3   12  c9c 05003b70       220 Enabled  00000000:00000000 000eed48     0 Ukn&lt;br /&gt;   5   13 1a84 04ff7a60       220 Enabled  00000000:00000000 000eed48     0 Ukn&lt;br /&gt;   2   14 253c 0d378ee0       220 Enabled  00000000:00000000 000eed48     0 Ukn&lt;br /&gt;  42   15 1760 0d38b3d8       220 Enabled  00000000:00000000 000eed48     0 Ukn&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;Dumping the managed stack for thread 36, the recursion is quite obvious:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;0:036&amp;gt; !clrstack&lt;br /&gt;OS Thread Id: 0x1e60 (36)&lt;br /&gt;ESP       EIP     &lt;br /&gt;04e94acc 77e42004 [FaultingExceptionFrame: 04e94acc] &lt;br /&gt;04e95058 77e42004 [HelperMethodFrame: 04e95058] &lt;br /&gt;04e950c4 65230cc1 System.Data.RBTree`1+TreePage[[System.__Canon, mscorlib]]..ctor(Int32)&lt;br /&gt;04e950d4 65230abe System.Data.RBTree`1[[System.__Canon, mscorlib]].AllocPage(Int32)&lt;br /&gt;04e950f8 652309fc System.Data.RBTree`1[[System.__Canon, mscorlib]].InitTree()&lt;br /&gt;04e95108 65230961 System.Data.DataRowCollection..ctor(System.Data.DataTable)&lt;br /&gt;04e95118 652307c2 System.Data.DataTable..ctor()&lt;br /&gt;04e95134 65230535 System.Data.Common.DataTableMapping.GetDataTableBySchemaAction(System.Data.DataSet, System.Data.MissingSchemaAction)&lt;br /&gt;04e95150 6523037c System.Data.ProviderBase.SchemaMapping..ctor(System.Data.Common.DataAdapter, System.Data.DataSet, System.Data.DataTable, System.Data.ProviderBase.DataReaderContainer, Boolean, System.Data.SchemaType, System.String, Boolean, System.Data.DataColumn, System.Object)&lt;br /&gt;04e9519c 6522fbac System.Data.Common.DataAdapter.FillMappingInternal(System.Data.DataSet, System.Data.DataTable, System.String, System.Data.ProviderBase.DataReaderContainer, Int32, System.Data.DataColumn, System.Object)&lt;br /&gt;04e951d0 6522fc1e System.Data.Common.DataAdapter.FillMapping(System.Data.DataSet, System.Data.DataTable, System.String, System.Data.ProviderBase.DataReaderContainer, Int32, System.Data.DataColumn, System.Object)&lt;br /&gt;04e95218 6522f9e6 System.Data.Common.DataAdapter.FillFromReader(System.Data.DataSet, System.Data.DataTable, System.String, System.Data.ProviderBase.DataReaderContainer, Int32, Int32, System.Data.DataColumn, System.Object)&lt;br /&gt;04e95270 6522f942 System.Data.Common.DataAdapter.Fill(System.Data.DataSet, System.String, System.Data.IDataReader, Int32, Int32)&lt;br /&gt;04e952b4 65230105 System.Data.Common.DbDataAdapter.FillInternal(System.Data.DataSet, System.Data.DataTable[], Int32, Int32, System.String, System.Data.IDbCommand, System.Data.CommandBehavior)&lt;br /&gt;04e9530c 65230010 System.Data.Common.DbDataAdapter.Fill(System.Data.DataSet, Int32, Int32, System.String, System.Data.IDbCommand, System.Data.CommandBehavior)&lt;br /&gt;04e95350 6559401d System.Data.Common.DbDataAdapter.Fill(System.Data.DataSet, System.String)&lt;br /&gt;04e95384 6678d11f System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(System.Web.UI.DataSourceSelectArguments)&lt;br /&gt;04e95424 6668f498 System.Web.UI.DataSourceView.Select(System.Web.UI.DataSourceSelectArguments, System.Web.UI.DataSourceViewSelectCallback)&lt;br /&gt;04e95434 66792c0f System.Web.UI.WebControls.DataBoundControl.PerformSelect()&lt;br /&gt;04e9544c 6679285e System.Web.UI.WebControls.BaseDataBoundControl.DataBind()&lt;br /&gt;04e95458 667dcf35 System.Web.UI.WebControls.GridView.DataBind()&lt;br /&gt;04e9545c 660e1ac3 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound()&lt;br /&gt;04e95488 668ecdcd System.Web.UI.WebControls.BaseDataBoundControl.set_RequiresDataBinding(Boolean)&lt;br /&gt;04e95498 667da23b System.Web.UI.WebControls.GridView.set_PageIndex(Int32)&lt;br /&gt;&lt;font color="#ff0000"&gt;&lt;strong&gt;04e954a8 0ad3e096 ASP.search_aspx.Gridview1_DataBound(System.Object, System.EventArgs)&lt;br /&gt;04e959a8 667928ce System.Web.UI.WebControls.BaseDataBoundControl.OnDataBound(System.EventArgs)&lt;br /&gt;04e959bc 66792b45 System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(System.Collections.IEnumerable)&lt;br /&gt;04e959cc 6668f4a4 System.Web.UI.DataSourceView.Select(System.Web.UI.DataSourceSelectArguments, System.Web.UI.DataSourceViewSelectCallback)&lt;br /&gt;04e959dc 66792c0f System.Web.UI.WebControls.DataBoundControl.PerformSelect()&lt;br /&gt;04e959f4 6679285e System.Web.UI.WebControls.BaseDataBoundControl.DataBind()&lt;br /&gt;04e95a00 667dcf35 System.Web.UI.WebControls.GridView.DataBind()&lt;br /&gt;04e95a04 660e1ac3 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound()&lt;br /&gt;04e95a30 668ecdcd System.Web.UI.WebControls.BaseDataBoundControl.set_RequiresDataBinding(Boolean)&lt;br /&gt;04e95a40 667da23b System.Web.UI.WebControls.GridView.set_PageIndex(Int32)&lt;/strong&gt;&lt;/font&gt;&lt;br /&gt;04e95a50 0ad3e096 ASP.search_aspx.Gridview1_DataBound(System.Object, System.EventArgs)&lt;br /&gt;04e95f50 667928ce System.Web.UI.WebControls.BaseDataBoundControl.OnDataBound(System.EventArgs)&lt;br /&gt;04e95f64 66792b45 System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(System.Collections.IEnumerable)&lt;br /&gt;04e95f74 6668f4a4 System.Web.UI.DataSourceView.Select(System.Web.UI.DataSourceSelectArguments, System.Web.UI.DataSourceViewSelectCallback)&lt;br /&gt;04e95f84 66792c0f System.Web.UI.WebControls.DataBoundControl.PerformSelect()&lt;br /&gt;04e95f9c 6679285e System.Web.UI.WebControls.BaseDataBoundControl.DataBind()&lt;br /&gt;04e95fa8 667dcf35 System.Web.UI.WebControls.GridView.DataBind()&lt;br /&gt;04e95fac 660e1ac3 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound()&lt;br /&gt;04e95fd8 668ecdcd System.Web.UI.WebControls.BaseDataBoundControl.set_RequiresDataBinding(Boolean)&lt;br /&gt;04e95fe8 667da23b System.Web.UI.WebControls.GridView.set_PageIndex(Int32)&lt;br /&gt;04e95ff8 0ad3e096 ASP.search_aspx.Gridview1_DataBound(System.Object, System.EventArgs)&lt;br /&gt;&lt;br /&gt;[...]&lt;br /&gt;04ebea70 0ad3e096 ASP.search_aspx.Gridview1_DataBound(System.Object, System.EventArgs)&lt;br /&gt;04ebef70 667928ce System.Web.UI.WebControls.BaseDataBoundControl.OnDataBound(System.EventArgs)&lt;br /&gt;04ebef84 66792b45 System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(System.Collections.IEnumerable)&lt;br /&gt;04ebef94 6668f4a4 System.Web.UI.DataSourceView.Select(System.Web.UI.DataSourceSelectArguments, System.Web.UI.DataSourceViewSelectCallback)&lt;br /&gt;04ebefa4 66792c0f System.Web.UI.WebControls.DataBoundControl.PerformSelect()&lt;br /&gt;04ebefbc 6679285e System.Web.UI.WebControls.BaseDataBoundControl.DataBind()&lt;br /&gt;04ebefc8 667dcf35 System.Web.UI.WebControls.GridView.DataBind()&lt;br /&gt;04ebefcc 660e1ac3 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound()&lt;br /&gt;04ebeff8 660e1a57 System.Web.UI.WebControls.BaseDataBoundControl.OnPreRender(System.EventArgs)&lt;br /&gt;04ebf008 667e07da System.Web.UI.WebControls.GridView.OnPreRender(System.EventArgs)&lt;br /&gt;04ebf030 660abc21 System.Web.UI.Control.PreRenderRecursiveInternal()&lt;br /&gt;04ebf048 660abc7c System.Web.UI.Control.PreRenderRecursiveInternal()&lt;br /&gt;04ebf060 660abc7c System.Web.UI.Control.PreRenderRecursiveInternal()&lt;br /&gt;04ebf078 660abc7c System.Web.UI.Control.PreRenderRecursiveInternal()&lt;br /&gt;04ebf090 660abc7c System.Web.UI.Control.PreRenderRecursiveInternal()&lt;br /&gt;04ebf0a8 660a7c4b System.Web.UI.Page.ProcessRequestMain(Boolean, Boolean)&lt;br /&gt;04ebf200 660a77a4 System.Web.UI.Page.ProcessRequest(Boolean, Boolean)&lt;br /&gt;04ebf238 660a76d1 System.Web.UI.Page.ProcessRequest()&lt;br /&gt;04ebf270 660a7666 System.Web.UI.Page.ProcessRequestWithNoAssert(System.Web.HttpContext)&lt;br /&gt;04ebf27c 660a7642 System.Web.UI.Page.ProcessRequest(System.Web.HttpContext)&lt;br /&gt;04ebf290 0ad37afe ASP.search_aspx.ProcessRequest(System.Web.HttpContext)&lt;br /&gt;04ebf2a0 660adb16 System.Web.HttpApplication+CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()&lt;br /&gt;04ebf2d4 6608132c System.Web.HttpApplication.ExecuteStep(IExecutionStep, Boolean ByRef)&lt;br /&gt;04ebf314 6608c5c3 System.Web.HttpApplication+ApplicationStepManager.ResumeSteps(System.Exception)&lt;br /&gt;04ebf364 660808ac System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(System.Web.HttpContext, System.AsyncCallback, System.Object)&lt;br /&gt;04ebf380 66083e1c System.Web.HttpRuntime.ProcessRequestInternal(System.Web.HttpWorkerRequest)&lt;br /&gt;04ebf3b4 66083ac3 System.Web.HttpRuntime.ProcessRequestNoDemand(System.Web.HttpWorkerRequest)&lt;br /&gt;04ebf3c4 66082c5c System.Web.Hosting.ISAPIRuntime.ProcessRequest(IntPtr, Int32)&lt;br /&gt;04ebf5d8 79f68cde [ContextTransitionFrame: 04ebf5d8] &lt;br /&gt;04ebf60c 79f68cde [GCFrame: 04ebf60c] &lt;br /&gt;04ebf768 79f68cde [ComMethodFrame: 04ebf768] &lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;The next step is to find out why the &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.basedataboundcontrol.ondatabound.aspx" target="_blank"&gt;OnDataBound&lt;/a&gt; event is firing over and over; here is the source code for the faulting page (simplified to show only the relevant bits):&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;p&gt;&lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt; Page_Load(&lt;span style="color: #0000ff"&gt;ByVal&lt;/span&gt; Sender &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Object&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;ByVal&lt;/span&gt; E &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; EventArgs)&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; cmd &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;String&lt;/span&gt; = &lt;span style="color: #006080"&gt;&amp;quot;select * from products&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;If&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Not&lt;/span&gt; IsPostBack &lt;span style="color: #0000ff"&gt;Then&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;            &lt;span style="color: #008000"&gt;' when there is a blank search, display all products&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;If&lt;/span&gt; SearchString = &lt;span style="color: #006080"&gt;&amp;quot;&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Then&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;                SqlDataSource1.SelectCommand = cmd&lt;br /&gt;                &lt;font color="#ff0000"&gt;&lt;strong&gt;GridView1.DataBind()&lt;/strong&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;Else&lt;/span&gt;&lt;br /&gt;                &lt;span style="color: #008000"&gt;' when there are keywords (not a blank search)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;                &lt;span style="color: #008000"&gt;' some logic to change the sql query&lt;/span&gt;&lt;br /&gt;                &lt;font color="#ff0000"&gt;&lt;strong&gt;GridView1.DataBind()&lt;/strong&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;                &lt;span style="color: #0000ff"&gt;If&lt;/span&gt; GridView1.Rows.Count &amp;lt; 3 &lt;span style="color: #0000ff"&gt;Then&lt;/span&gt; &lt;span style="color: #008000"&gt;' displays suggestions if results are less then 3&lt;/span&gt;&lt;br /&gt;                    &lt;span style="color: #0000ff"&gt;For&lt;/span&gt; i = 0 &lt;span style="color: #0000ff"&gt;To&lt;/span&gt; Keywords.Count - 1&lt;br /&gt;                        &lt;span style="color: #008000"&gt;' some logic to change the sql query&lt;/span&gt;&lt;br /&gt;                        &lt;font color="#ff0000"&gt;&lt;strong&gt;GridView1.DataBind()&lt;br /&gt;&lt;/strong&gt;&lt;/font&gt;                    &lt;span style="color: #0000ff"&gt;Next&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;                    &lt;span style="color: #0000ff"&gt;For&lt;/span&gt; i = 0 &lt;span style="color: #0000ff"&gt;To&lt;/span&gt; FoundNewKeywords.Count - 1&lt;br /&gt;                        &lt;span style="color: #0000ff"&gt;For&lt;/span&gt; s = 0 &lt;span style="color: #0000ff"&gt;To&lt;/span&gt; Keywords.Count - 1&lt;br /&gt;                            &lt;span style="color: #008000"&gt;' some logic to change the sql query&lt;/span&gt;&lt;br /&gt;                            &lt;font color="#ff0000"&gt;&lt;strong&gt;GridView1.DataBind()&lt;/strong&gt;&lt;/font&gt;&lt;br /&gt;                        &lt;span style="color: #0000ff"&gt;Next&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;                        &lt;span style="color: #0000ff"&gt;For&lt;/span&gt; j = i &lt;span style="color: #0000ff"&gt;To&lt;/span&gt; FoundNewKeywords.Count - 1&lt;br /&gt;                            &lt;span style="color: #008000"&gt;' some logic to change the sql query&lt;/span&gt;&lt;br /&gt;                            &lt;font color="#ff0000"&gt;&lt;strong&gt;GridView1.DataBind()&lt;/strong&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;                            &lt;span style="color: #0000ff"&gt;If&lt;/span&gt; j = FoundNewKeywords.Count - 1 &lt;span style="color: #0000ff"&gt;And&lt;/span&gt; FoundNewKeywords.Count &amp;gt; 2 &lt;span style="color: #0000ff"&gt;Then&lt;/span&gt;&lt;br /&gt;                                &lt;span style="color: #0000ff"&gt;For&lt;/span&gt; m = j - 1 &lt;span style="color: #0000ff"&gt;To&lt;/span&gt; 1 &lt;span style="color: #0000ff"&gt;Step&lt;/span&gt; -1&lt;br /&gt;                                    &lt;span style="color: #008000"&gt;' some logic to change the sql query&lt;/span&gt;&lt;br /&gt;                                    &lt;font color="#ff0000"&gt;&lt;strong&gt;GridView1.DataBind()&lt;br /&gt;&lt;/strong&gt;&lt;/font&gt;                                &lt;span style="color: #0000ff"&gt;Next&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;                                &lt;span style="color: #0000ff"&gt;If&lt;/span&gt; i &amp;lt; 1 &lt;span style="color: #0000ff"&gt;Then&lt;/span&gt;&lt;br /&gt;                                    &lt;span style="color: #0000ff"&gt;For&lt;/span&gt; m = 2 &lt;span style="color: #0000ff"&gt;To&lt;/span&gt; j - 1&lt;br /&gt;                                        &lt;span style="color: #008000"&gt;' some logic to change the sql query&lt;/span&gt;&lt;br /&gt;                                        &lt;font color="#ff0000"&gt;&lt;strong&gt;GridView1.DataBind()&lt;br /&gt;&lt;/strong&gt;&lt;/font&gt;                                    &lt;span style="color: #0000ff"&gt;Next&lt;/span&gt;&lt;br /&gt;                                &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;If&lt;/span&gt;&lt;br /&gt;                            &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;If&lt;/span&gt;&lt;br /&gt;                        &lt;span style="color: #0000ff"&gt;Next&lt;/span&gt;&lt;br /&gt;                    &lt;span style="color: #0000ff"&gt;Next&lt;/span&gt;&lt;br /&gt;                &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;If&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;If&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;If&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #0000ff"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt; Gridview1_DataBound(&lt;span style="color: #0000ff"&gt;ByVal&lt;/span&gt; sender &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Object&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;ByVal&lt;/span&gt; e &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; EventArgs)&lt;br /&gt;        &lt;span style="color: #008000"&gt;' Some custom logic here&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; Sub&lt;/p&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;From a high level perspective the intention was to start with a “return everything” query and refine it step by step taking into account keywords specified by the user and add logic to suggest other records that might interest the user. From an operation standpoint calling DataBind() multiple times means the whole data binding logic is executed over and over, such as the custom DataBound event handler: that way, depending on what we’re doing, we could exhaust the stack space which is what was happening in this case.&lt;/p&gt;

&lt;p&gt;The solution is simple: there is no need to call DataBind() many times, just call it once after we have refined our query.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000080" size="3" face="Brush Script MT"&gt;Carlo&lt;/font&gt;&lt;/p&gt;
&lt;b&gt;&lt;i&gt;Quote of the day: &lt;/i&gt;&lt;/b&gt;

&lt;br /&gt;To avoid situations in which you might make mistakes may be the biggest mistake of all. - &lt;a href="http://en.wikipedia.org/wiki/Peter_mcwilliams" target="_blank"&gt;Peter McWilliams&lt;/a&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9571352" width="1" height="1"&gt;</content><author><name>Carlo  Cardella</name><uri>http://blogs.msdn.com/carloc/ProfileUrlRedirect.ashx</uri></author><category term="ASP.NET" scheme="http://blogs.msdn.com/b/carloc/archive/tags/ASP-NET/" /><category term="Debugging/Windbg" scheme="http://blogs.msdn.com/b/carloc/archive/tags/Debugging_2F00_Windbg/" /><category term="DataAccess" scheme="http://blogs.msdn.com/b/carloc/archive/tags/DataAccess/" /></entry><entry><title>Where’s my dump gone?!?</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/carloc/archive/2009/04/14/where-s-my-dump-gone.aspx" /><id>http://blogs.msdn.com/b/carloc/archive/2009/04/14/where-s-my-dump-gone.aspx</id><published>2009-04-14T20:45:37Z</published><updated>2009-04-14T20:45:37Z</updated><content type="html">&lt;p&gt;Have you ever found yourself patiently waiting for a problem to reproduce with your debugger ready, and when it happens you just find there are no signs of your dump anywhere? If you are using &lt;a href="http://support.microsoft.com/kb/286350/" target="_blank"&gt;adplus&lt;/a&gt; you likely had the text logs, but nothing more…&lt;/p&gt;  &lt;p&gt;In such situations it is possible that the OS is terminating the process before the dump is fully written. If you are tying to dump an IIS process and you want to save some time and headaches, try this small cunning: temporarily disable the “Enable pinging” and “Enable rapid-fail protection” flags in the Health tab for your application pool:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/7128.defaultapppool-properties_5F00_2.png" target="_blank"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px" class="wlDisabledImage" title="" border="0" alt="Health tab" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/8306.defaultapppool-properties_5F00_thumb.png" width="400" height="378" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Sometimes can be useful to tell IIS to not kill a failing worker process but rather leave it orphaned:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://technet.microsoft.com/en-us/library/cc759201.aspx" target="_blank"&gt;Features of Worker Process Isolation Mode&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;h4&gt;&lt;em&gt;Orphaning Worker Processes&lt;/em&gt;&lt;/h4&gt;    &lt;p&gt;&lt;em&gt;You can configure worker process isolation mode to orphan a worker process that the WWW service deems to be failing. The WWW service usually terminates a failing worker process and replaces it. If you enable orphaning, the WWW service allows a failing worker process to continue running, but separates it from the application pool (making it an orphan) and starts a new worker process in its place. You can configure the WWW service to run a command on the orphaned worker process — for example, launching a debugger.&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;For more information about orphaning worker processes, including how to configure this feature, see &lt;/em&gt;&lt;a href="http://technet.microsoft.com/15820367-2aac-49be-9a6f-5b6f6e5d074f"&gt;&lt;em&gt;Running IIS 6.0 as an Application Server&lt;/em&gt;&lt;/a&gt;&lt;em&gt; in this book and &lt;/em&gt;&lt;em&gt;OrphanWorkerProcess Metabase Property&lt;/em&gt;&lt;em&gt; metabase property.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;In IIS 6 there the following three metabase properties can be handy to run some custom actions in case of an application pool failure:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://technet.microsoft.com/en-us/library/cc739430.aspx" target="_blank"&gt;OrphanWorkerProcess&lt;/a&gt;: The OrphanWorkerProcess property, when set to true, notifies the World Wide Web Publishing Service (WWW Service) not to terminate a worker process that fails to respond to pings, but to instead orphan the worker process in the application pool if the worker process suffers fatal errors &lt;/li&gt;    &lt;li&gt;&lt;a href="http://technet.microsoft.com/en-us/library/cc782598.aspx" target="_blank"&gt;OrphanActionParams&lt;/a&gt;: The OrphanActionParams property specifies command-line parameters for the executable specified by the OrphanActionExe Metabase Property. To specify the process ID of the orphaned process, use %1%. &lt;/li&gt;    &lt;li&gt;&lt;a href="http://technet.microsoft.com/en-us/library/cc779822.aspx" target="_blank"&gt;OrphanActionExe&lt;/a&gt;: The OrphanActionExe property specifies an executable to run when the World Wide Web Publishing Service (WWW service) orphans a worker process. You can use the OrphanActionParams Metabase Property to send parameters to the executable &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The article &lt;a href="http://support.microsoft.com/kb/828222" target="_blank"&gt;How to generate a dump file when ASP.NET deadlocks in IIS 6.0&lt;/a&gt; explains how to use the properties above and despite its title, you can use this technique to run the custom actions you need/want not only in case of an ASP.NET deadlock but in every circumstance that fits your needs.&lt;/p&gt;  &lt;p&gt;In IIS 7 you can easily use the Advanced Settings dialog or your application pool:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/1374.advanced-settings_5F00_2.png" target="_blank"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px" class="wlDisabledImage" title="" border="0" alt="Advanced Settings" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/5584.advanced-settings_5F00_thumb.png" width="354" height="480" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Finally, while w3wp.exe cannot run without &lt;a href="http://technet.microsoft.com/en-us/library/cc738483.aspx" target="_blank"&gt;Data Execution Prevention&lt;/a&gt;, if you are debugging a custom process you may want to add it to the exclusion list: &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/5428.data-execution-prevention_5F00_2.png" target="_blank"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px" class="wlDisabledImage" title="" border="0" alt="Data Execution Prevention" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-05-metablogapi/4861.data-execution-prevention_5F00_thumb.png" width="378" height="480" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="3" face="Brush Script MT"&gt;Carlo&lt;/font&gt;&lt;/p&gt; &lt;b&gt;&lt;i&gt;Quote of the day: &lt;/i&gt;&lt;/b&gt;  &lt;br /&gt;If the only tool you have is a hammer, you tend to see every problem as a nail. - &lt;a href="http://en.wikipedia.org/wiki/Abraham_Maslow" target="_blank"&gt;Abraham Maslow&lt;/a&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9549168" width="1" height="1"&gt;</content><author><name>Carlo  Cardella</name><uri>http://blogs.msdn.com/carloc/ProfileUrlRedirect.ashx</uri></author><category term="Debugging/Windbg" scheme="http://blogs.msdn.com/b/carloc/archive/tags/Debugging_2F00_Windbg/" /></entry></feed>