<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Never doubt thy debugger</title><link>http://blogs.msdn.com/carloc/default.aspx</link><description /><dc:language>it-IT</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Missing ASP.NET Tab (this time on Windows 2000)</title><link>http://blogs.msdn.com/carloc/archive/2009/10/14/missing-asp-net-tab-this-time-on-windows-2000.aspx</link><pubDate>Wed, 14 Oct 2009 14:00:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9907147</guid><dc:creator>Carlo Cardella</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/carloc/comments/9907147.aspx</comments><wfw:commentRss>http://blogs.msdn.com/carloc/commentrss.aspx?PostID=9907147</wfw:commentRss><wfw:comment>http://blogs.msdn.com/carloc/rsscomments.aspx?PostID=9907147</wfw:comment><description>&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-bottom: 0px; border-left: 0px; margin: 0px; display: inline; border-top: 0px; border-right: 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-bottom: 0px; border-left: 0px; margin: 0px; display: inline; border-top: 0px; border-right: 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-bottom: 0px; border-left: 0px; margin: 0px; display: inline; border-top: 0px; border-right: 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-bottom: 0px; border-left: 0px; margin: 0px; display: inline; border-top: 0px; border-right: 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 alt="smile_nerd" src="http://spaces.live.com/rte/emoticons/smile_nerd.gif" /&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;</description><category domain="http://blogs.msdn.com/carloc/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/carloc/archive/tags/IIS/default.aspx">IIS</category></item><item><title>Input validation and another StackOverflow</title><link>http://blogs.msdn.com/carloc/archive/2009/10/06/net-runtime-2-0-error-event-id-1000.aspx</link><pubDate>Tue, 06 Oct 2009 17:55:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9903757</guid><dc:creator>Carlo Cardella</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/carloc/comments/9903757.aspx</comments><wfw:commentRss>http://blogs.msdn.com/carloc/commentrss.aspx?PostID=9903757</wfw:commentRss><wfw:comment>http://blogs.msdn.com/carloc/rsscomments.aspx?PostID=9903757</wfw:comment><description>&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 alt="smile_nerd" src="http://spaces.live.com/rte/emoticons/smile_nerd.gif" /&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;</description><category domain="http://blogs.msdn.com/carloc/archive/tags/Debugging_2F00_Windbg/default.aspx">Debugging/Windbg</category></item><item><title>New opening: Italian Dev Support blog</title><link>http://blogs.msdn.com/carloc/archive/2009/09/11/new-opening-italian-dev-support-blog.aspx</link><pubDate>Fri, 11 Sep 2009 10:20:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9894057</guid><dc:creator>Carlo Cardella</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/carloc/comments/9894057.aspx</comments><wfw:commentRss>http://blogs.msdn.com/carloc/commentrss.aspx?PostID=9894057</wfw:commentRss><wfw:comment>http://blogs.msdn.com/carloc/rsscomments.aspx?PostID=9894057</wfw:comment><description>&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 alt="smile_nerd" src="http://spaces.live.com/rte/emoticons/smile_nerd.gif" /&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;</description><category domain="http://blogs.msdn.com/carloc/archive/tags/Italian+techs/default.aspx">Italian techs</category></item><item><title>Hosting on a UNC share is not supported for the Windows XP Platform</title><link>http://blogs.msdn.com/carloc/archive/2009/09/06/hosting-on-a-unc-share-is-not-supported-for-the-windows-xp-platform.aspx</link><pubDate>Sun, 06 Sep 2009 12:43:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9891911</guid><dc:creator>Carlo Cardella</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/carloc/comments/9891911.aspx</comments><wfw:commentRss>http://blogs.msdn.com/carloc/commentrss.aspx?PostID=9891911</wfw:commentRss><wfw:comment>http://blogs.msdn.com/carloc/rsscomments.aspx?PostID=9891911</wfw:comment><description>&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;</description><category domain="http://blogs.msdn.com/carloc/archive/tags/Visual+Studio/default.aspx">Visual Studio</category></item><item><title>An authentication error occurred while communicating with the web server</title><link>http://blogs.msdn.com/carloc/archive/2009/08/30/an-authentication-error-occurred-while-communicating-with-the-web-server.aspx</link><pubDate>Sun, 30 Aug 2009 23:25:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9889137</guid><dc:creator>Carlo Cardella</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/carloc/comments/9889137.aspx</comments><wfw:commentRss>http://blogs.msdn.com/carloc/commentrss.aspx?PostID=9889137</wfw:commentRss><wfw:comment>http://blogs.msdn.com/carloc/rsscomments.aspx?PostID=9889137</wfw:comment><description>&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 alt="smile_regular" src="http://spaces.live.com/rte/emoticons/smile_regular.gif" /&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;/li&gt;    &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;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;</description><category domain="http://blogs.msdn.com/carloc/archive/tags/Visual+Studio/default.aspx">Visual Studio</category></item><item><title>Security advisory bulletin 973882 (July 28, 2009)</title><link>http://blogs.msdn.com/carloc/archive/2009/07/29/security-advisory-bulletin-973882-july-28-2009.aspx</link><pubDate>Wed, 29 Jul 2009 09:40:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9851774</guid><dc:creator>Carlo Cardella</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/carloc/comments/9851774.aspx</comments><wfw:commentRss>http://blogs.msdn.com/carloc/commentrss.aspx?PostID=9851774</wfw:commentRss><wfw:comment>http://blogs.msdn.com/carloc/rsscomments.aspx?PostID=9851774</wfw:comment><description>&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;</description><category domain="http://blogs.msdn.com/carloc/archive/tags/Hotfix_2F00_Service+Pack/default.aspx">Hotfix/Service Pack</category></item><item><title>ASP.NET 1.1 not configurable in IIS Manager?</title><link>http://blogs.msdn.com/carloc/archive/2009/07/28/asp-net-1-1-not-configurable-in-iis-manager.aspx</link><pubDate>Tue, 28 Jul 2009 16:26:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9851017</guid><dc:creator>Carlo Cardella</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/carloc/comments/9851017.aspx</comments><wfw:commentRss>http://blogs.msdn.com/carloc/commentrss.aspx?PostID=9851017</wfw:commentRss><wfw:comment>http://blogs.msdn.com/carloc/rsscomments.aspx?PostID=9851017</wfw:comment><description>&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://www.devdebug.members.winisp.net/images/msdnblog/stanislaospro.1nonconfigurabileinIIS7x64_12648/image.png" target="_blank"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px; display: inline; border-top: 0px; border-right: 0px" title="Missing &amp;quot;ASP.NET&amp;quot; group" border="0" alt="Missing &amp;quot;ASP.NET&amp;quot; group" src="http://www.devdebug.members.winisp.net/images/msdnblog/stanislaospro.1nonconfigurabileinIIS7x64_12648/image_thumb.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;&amp;#160;&lt;a href="http://www.devdebug.members.winisp.net/images/msdnblog/stanislaospro.1nonconfigurabileinIIS7x64_12648/image_3.png" target="_blank"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px; display: inline; border-top: 0px; border-right: 0px" title="With &amp;quot;ASP.NET&amp;quot; group" border="0" alt="With &amp;quot;ASP.NET&amp;quot; group" src="http://www.devdebug.members.winisp.net/images/msdnblog/stanislaospro.1nonconfigurabileinIIS7x64_12648/image_thumb_3.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 alt="smile_nerd" src="http://spaces.live.com/rte/emoticons/smile_nerd.gif" /&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;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;</description><category domain="http://blogs.msdn.com/carloc/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/carloc/archive/tags/IIS/default.aspx">IIS</category></item><item><title>Thread exit may kill your Session</title><link>http://blogs.msdn.com/carloc/archive/2009/07/24/thread-exit-may-kill-your-session.aspx</link><pubDate>Fri, 24 Jul 2009 17:38:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9847627</guid><dc:creator>Carlo Cardella</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/carloc/comments/9847627.aspx</comments><wfw:commentRss>http://blogs.msdn.com/carloc/commentrss.aspx?PostID=9847627</wfw:commentRss><wfw:comment>http://blogs.msdn.com/carloc/rsscomments.aspx?PostID=9847627</wfw:comment><description>&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 alt="smile_nerd" src="http://spaces.live.com/rte/emoticons/smile_nerd.gif" /&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;</description><category domain="http://blogs.msdn.com/carloc/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/carloc/archive/tags/CLR/default.aspx">CLR</category></item><item><title>StackOverflow continued: DataSource or DataSourceID?</title><link>http://blogs.msdn.com/carloc/archive/2009/07/23/stackoverflow-continued-datasource-or-datasourceid.aspx</link><pubDate>Thu, 23 Jul 2009 16:49:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9846326</guid><dc:creator>Carlo Cardella</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/carloc/comments/9846326.aspx</comments><wfw:commentRss>http://blogs.msdn.com/carloc/commentrss.aspx?PostID=9846326</wfw:commentRss><wfw:comment>http://blogs.msdn.com/carloc/rsscomments.aspx?PostID=9846326</wfw:comment><description>&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;</description><category domain="http://blogs.msdn.com/carloc/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item><item><title>SharePoint and Office Live? Access forbidden!</title><link>http://blogs.msdn.com/carloc/archive/2009/07/06/sharepoint-and-office-live-access-forbidden.aspx</link><pubDate>Mon, 06 Jul 2009 22:50:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9820493</guid><dc:creator>Carlo Cardella</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/carloc/comments/9820493.aspx</comments><wfw:commentRss>http://blogs.msdn.com/carloc/commentrss.aspx?PostID=9820493</wfw:commentRss><wfw:comment>http://blogs.msdn.com/carloc/rsscomments.aspx?PostID=9820493</wfw:comment><description>&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;</description><category domain="http://blogs.msdn.com/carloc/archive/tags/Hotfix_2F00_Service+Pack/default.aspx">Hotfix/Service Pack</category></item><item><title>Three errors, one cause: me!</title><link>http://blogs.msdn.com/carloc/archive/2009/06/03/three-errors-one-cause-me.aspx</link><pubDate>Wed, 03 Jun 2009 17:29:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9691390</guid><dc:creator>Carlo Cardella</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/carloc/comments/9691390.aspx</comments><wfw:commentRss>http://blogs.msdn.com/carloc/commentrss.aspx?PostID=9691390</wfw:commentRss><wfw:comment>http://blogs.msdn.com/carloc/rsscomments.aspx?PostID=9691390</wfw:comment><description>&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;&amp;#160;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Failed to connect" border="0" alt="Failed to connect" src="http://www.devdebug.members.winisp.net/images/msdnblog/d23a0198799f_CAC9/sshot1.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 style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Type initializer throw an exception" border="0" alt="Type initializer throw an exception" src="http://www.devdebug.members.winisp.net/images/msdnblog/d23a0198799f_CAC9/sshot3.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;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="The dependency service or group failed to start" border="0" alt="The dependency service or group failed to start" src="http://www.devdebug.members.winisp.net/images/msdnblog/d23a0198799f_CAC9/image.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 style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Could not start WAS service" border="0" alt="Could not start WAS service" src="http://www.devdebug.members.winisp.net/images/msdnblog/d23a0198799f_CAC9/image_3.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;&amp;#160;&lt;a href="http://www.devdebug.members.winisp.net/images/msdnblog/d23a0198799f_CAC9/sshot8.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" title="MMC could not create the snap-in" border="0" alt="MMC could not create the snap-in" src="http://www.devdebug.members.winisp.net/images/msdnblog/d23a0198799f_CAC9/sshot8_thumb.png" width="550" height="402" /&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 alt="smile_omg" src="http://spaces.live.com/rte/emoticons/smile_omg.gif" /&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&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 alt="smile_thinking" src="http://spaces.live.com/rte/emoticons/smile_thinking.gif" /&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 alt="smile_nerd" src="http://spaces.live.com/rte/emoticons/smile_nerd.gif" /&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 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;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;system.web&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;processModel&lt;/span&gt; &lt;span style="color: #ff0000"&gt;autoConfig&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;br /&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;processModel&lt;/span&gt; &lt;span style="color: #ff0000"&gt;autoConfig&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;minWorkerThreads&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;100&amp;quot;&lt;/span&gt; &lt;br /&gt;            &lt;span style="color: #ff0000"&gt;minIoThreads&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;100&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;maxWorkerThreads&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;404&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;maxIoThreads&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;404&amp;quot;&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;httpRuntime&lt;/span&gt; &lt;span style="color: #ff0000"&gt;minFreeThreads&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;152&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;minLocalRequestFreeThreads&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;152&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&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 alt="smile_embaressed" src="http://spaces.live.com/rte/emoticons/smile_embaressed.gif" /&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;</description><category domain="http://blogs.msdn.com/carloc/archive/tags/IIS/default.aspx">IIS</category><category domain="http://blogs.msdn.com/carloc/archive/tags/Vista_2F00_Longhorn/default.aspx">Vista/Longhorn</category></item><item><title>Logparser automated within Windbg</title><link>http://blogs.msdn.com/carloc/archive/2009/05/08/logparser-automated-within-windbg.aspx</link><pubDate>Fri, 08 May 2009 19:50:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9597291</guid><dc:creator>Carlo Cardella</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/carloc/comments/9597291.aspx</comments><wfw:commentRss>http://blogs.msdn.com/carloc/commentrss.aspx?PostID=9597291</wfw:commentRss><wfw:comment>http://blogs.msdn.com/carloc/rsscomments.aspx?PostID=9597291</wfw:comment><description>&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;</description><category domain="http://blogs.msdn.com/carloc/archive/tags/Debugging_2F00_Windbg/default.aspx">Debugging/Windbg</category><category domain="http://blogs.msdn.com/carloc/archive/tags/LogParser/default.aspx">LogParser</category></item><item><title>StackOverflowException and DataBind()</title><link>http://blogs.msdn.com/carloc/archive/2009/04/27/stackoverflowexception-and-databind.aspx</link><pubDate>Mon, 27 Apr 2009 20:05:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9571352</guid><dc:creator>Carlo Cardella</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/carloc/comments/9571352.aspx</comments><wfw:commentRss>http://blogs.msdn.com/carloc/commentrss.aspx?PostID=9571352</wfw:commentRss><wfw:comment>http://blogs.msdn.com/carloc/rsscomments.aspx?PostID=9571352</wfw:comment><description>&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;</description><category domain="http://blogs.msdn.com/carloc/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/carloc/archive/tags/Debugging_2F00_Windbg/default.aspx">Debugging/Windbg</category><category domain="http://blogs.msdn.com/carloc/archive/tags/DataAccess/default.aspx">DataAccess</category></item><item><title>Where’s my dump gone?!?</title><link>http://blogs.msdn.com/carloc/archive/2009/04/14/where-s-my-dump-gone.aspx</link><pubDate>Tue, 14 Apr 2009 23:45:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9549168</guid><dc:creator>Carlo Cardella</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/carloc/comments/9549168.aspx</comments><wfw:commentRss>http://blogs.msdn.com/carloc/commentrss.aspx?PostID=9549168</wfw:commentRss><wfw:comment>http://blogs.msdn.com/carloc/rsscomments.aspx?PostID=9549168</wfw:comment><description>&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;&lt;a href="http://www.devdebug.members.winisp.net/images/msdnblog/9645cca495f1_7ABC/image.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" title="Health tab" border="0" alt="Health tab" src="http://www.devdebug.members.winisp.net/images/msdnblog/9645cca495f1_7ABC/image_thumb.png" width="390" height="369" /&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;&lt;a href="http://www.devdebug.members.winisp.net/images/msdnblog/9645cca495f1_7ABC/image_3.png" target="_blank"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Advanced Settings in IIS 7" border="0" alt="Advanced Settings in IIS 7" src="http://www.devdebug.members.winisp.net/images/msdnblog/9645cca495f1_7ABC/image_thumb_3.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://www.devdebug.members.winisp.net/images/msdnblog/9645cca495f1_7ABC/image_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" title="Data Execution Prevention" border="0" alt="Data Execution Prevention" src="http://www.devdebug.members.winisp.net/images/msdnblog/9645cca495f1_7ABC/image_thumb_4.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;</description><category domain="http://blogs.msdn.com/carloc/archive/tags/Debugging_2F00_Windbg/default.aspx">Debugging/Windbg</category></item><item><title>WPF, 3D and services: supported (again)?</title><link>http://blogs.msdn.com/carloc/archive/2009/04/09/wpf-3d-and-services-supported-again.aspx</link><pubDate>Thu, 09 Apr 2009 11:48:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9539801</guid><dc:creator>Carlo Cardella</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/carloc/comments/9539801.aspx</comments><wfw:commentRss>http://blogs.msdn.com/carloc/commentrss.aspx?PostID=9539801</wfw:commentRss><wfw:comment>http://blogs.msdn.com/carloc/rsscomments.aspx?PostID=9539801</wfw:comment><description>&lt;p&gt;I wrote about why &lt;a href="http://blogs.msdn.com/carloc/archive/2007/03/17/charting-in-asp-net-alas-dgi-not-supported-from-a-service.aspx" target="_blank" mce_href="http://blogs.msdn.com/carloc/archive/2007/03/17/charting-in-asp-net-alas-dgi-not-supported-from-a-service.aspx"&gt;GDI+ is not supported in a service&lt;/a&gt; a couple of years ago but this is still a debated topic (or I should better say a&lt;em&gt; misunderstood&lt;/em&gt; topic), then &lt;a href="http://msdn.microsoft.com/en-us/library/ms754130.aspx" target="_blank" mce_href="http://msdn.microsoft.com/en-us/library/ms754130.aspx"&gt;WPF&lt;/a&gt; (Windows Presentation Foundation) came into the game and it brought some more uncertainties with it.&lt;/p&gt;  &lt;p&gt;Recently I worked on a custom application which basically was meant to made of a Windows Form client and a &lt;a href="http://msdn.microsoft.com/en-us/library/ms735119.aspx" target="_blank" mce_href="http://msdn.microsoft.com/en-us/library/ms735119.aspx"&gt;WCF&lt;/a&gt; Web Service used to get some data from a database, create a 3D image (a sort of chart) and send it to the client as a jpg image; the graphic part was done using classes such as &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.viewport3d.aspx" target="_blank" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.controls.viewport3d.aspx"&gt;Viewport3D&lt;/a&gt;, &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.media.media3d.perspectivecamera.aspx" target="_blank" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.media.media3d.perspectivecamera.aspx"&gt;PerspectiveCamera&lt;/a&gt;, &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.media.media3d.modelvisual3d.aspx" target="_blank" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.media.media3d.modelvisual3d.aspx"&gt;ModelVisual3D&lt;/a&gt;, &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.rendertargetbitmap.aspx" target="_blank" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.rendertargetbitmap.aspx"&gt;RenderTargetBitmap&lt;/a&gt; and others taken from the &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.media.aspx" target="_blank" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.media.aspx"&gt;System.Windows.Media&lt;/a&gt;.*&amp;#160; and &lt;a href="http://msdn.microsoft.com/en-us/library/system.drawing.aspx" target="_blank" mce_href="http://msdn.microsoft.com/en-us/library/system.drawing.aspx"&gt;System.Drawing&lt;/a&gt; namespaces.&lt;/p&gt;  &lt;p&gt;Everything was working fine as long as the project was being developed and debugged against the &lt;a href="http://msdn.microsoft.com/en-us/library/58wxa9w5.aspx" target="_blank" mce_href="http://msdn.microsoft.com/en-us/library/58wxa9w5.aspx"&gt;ASP.NET Development Server&lt;/a&gt; (Cassini), but when the project was deployed to IIS7 the image returned was missing the 3D part and the fancy transparency and shadow effects added through WPF classes, it merely had a blue background, nothing more.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.devdebug.members.winisp.net/images/msdnblog/630b896c193a_142C2/image.png" target="_blank" mce_href="http://www.devdebug.members.winisp.net/images/msdnblog/630b896c193a_142C2/image.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="Application Pool advanced settings" border="0" alt="Application Pool advanced settings" src="http://www.devdebug.members.winisp.net/images/msdnblog/630b896c193a_142C2/image_thumb.png" width="354" height="480" mce_src="http://www.devdebug.members.winisp.net/images/msdnblog/630b896c193a_142C2/image_thumb.png" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The first thing I thought to, are the differences between Cassini and IIS: the former is a process (not a service), it runs under the credentials of the logged on user and also has Administrator rights as Visual Studio does (or should, to work properly). In IIS7 is really easy to test if this was a permission or missing user desktop issue, I changed the &lt;em&gt;Identity&lt;/em&gt; property for the application pool to run it under my domain account and changed the &lt;em&gt;Load User Profile&lt;/em&gt; to &lt;em&gt;true&lt;/em&gt; to have access the my system variables, registry etc…&lt;/p&gt;  &lt;p&gt;No luck.&lt;/p&gt;  &lt;p&gt;I’ll save you the other tests I’ve done, what is important to know is that there actually is another difference between IIS and Cassini on Windows 2008 / Vista, or I should better say one of the differences I have mentioned before has an important implication on those platforms: services now run in an isolated session (Session 0) while processes run in the session assigned to the user logged on the machine: &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb756986.aspx" target="_blank" mce_href="http://msdn.microsoft.com/en-us/library/bb756986.aspx"&gt;Application Compatibility: Session 0 Isolation&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;In Windows XP®, Windows Server® 2003, and earlier versions of the Windows® operating system, all services run in the same session as the first user who logs on to the console. This session is called Session 0. Running services and user applications together in Session 0 poses a security risk because services run at elevated privilege and therefore are targets for malicious agents that are looking for a means to elevate their own privilege levels. &lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;The Windows Vista® and Windows Server® 2008 operating systems mitigate this security risk by isolating services in Session 0 and making Session 0 non-interactive. In Windows Vista and Windows Server 2008, only system processes and services run in Session 0. The first user logs on to Session 1, and subsequent users log on to subsequent sessions. This approach means that services never run in the same session as users' applications and are therefore protected from attacks that originate in application code. &lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Specific examples of affected driver classes include: &lt;/em&gt;&lt;/p&gt;    &lt;ul&gt;     &lt;li&gt;&lt;em&gt;Printer drivers, which are loaded by the spooler service&lt;/em&gt;&lt;/li&gt;      &lt;li&gt;&lt;em&gt;All drivers authored with the User Mode Driver Framework (UMDF) because these drivers are hosted by a process in Session 0&lt;/em&gt;&lt;/li&gt;   &lt;/ul&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Application classes affected by this feature include: &lt;/em&gt;&lt;/p&gt;    &lt;ul&gt;     &lt;li&gt;&lt;em&gt;Services that create UI&lt;/em&gt;&lt;/li&gt;      &lt;li&gt;&lt;em&gt;A service that tries to use window-message functions such as SendMessage and PostMessage to communicate with an application&lt;/em&gt;&lt;/li&gt;      &lt;li&gt;&lt;em&gt;Applications creating globally named objects&lt;/em&gt;&lt;/li&gt;   &lt;/ul&gt; &lt;/blockquote&gt;  &lt;p&gt;This can easily been verified adding the “Session ID” column in Task Manager: as you can see, the WinForm client (Test3DInService.exe) is running in Session 2, w3wp.exe is running in Session 0 (despite the fact that the process is running as my domain account and it has loaded the user profile) and finally WebDev.WebServer.exe (Cassini) is running in Session 2:&lt;/p&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="Windows Sessions" border="0" alt="Windows Sessions" src="http://www.devdebug.members.winisp.net/images/msdnblog/630b896c193a_142C2/image_3.png" width="456" height="227" mce_src="http://www.devdebug.members.winisp.net/images/msdnblog/630b896c193a_142C2/image_3.png" /&gt; &lt;/p&gt;  &lt;p&gt;Even more important is this document: &lt;a href="http://www.microsoft.com/whdc/system/vista/services.mspx" target="_blank" mce_href="http://www.microsoft.com/whdc/system/vista/services.mspx"&gt;Impact of Session 0 Isolation on Services and Drivers in Windows Vista&lt;/a&gt;:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Because Session 0 is no longer a user session in Windows Vista, &lt;font color="#ff0000"&gt;services that are running in Session 0 do not have access to the video driver in Windows Vista. This means that any attempt that a service makes to render graphics fails&lt;/font&gt;. In current builds of Windows Vista, querying the display resolution and color depth in Session 0 reports the correct results for the system up to a maximum of 1920x1200 at 32 bits per pixel (bpp).&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Got it!&lt;/p&gt;  &lt;p&gt;Well, almost, but we’re pretty close. I said the blue background was actually created, and other simple 2D shapes could be successfully rendered as well, so the statement “&lt;em&gt;any attempt that a service makes to render graphic fails&lt;/em&gt;” is not fully correct, is should read as “&lt;em&gt;any attempt that a service makes to render graphics &lt;u&gt;that relies on the video driver&lt;/u&gt; fails&lt;/em&gt;”. Not all graphics need to interact with the video driver so generally speaking, GDI can be used (that’s a different set of libraries than GDI+) and “simple” graphic rendering should normally work fine (as if did in my sample with 2D graphics): the trick is never call (or try to call) into the video driver. This unfortunately means the fancy WPF shadows, transparencies and effects are off limits from a service. It is possible to use BIDs and &lt;a href="http://msdn.microsoft.com/en-us/library/dd183567(VS.85).aspx" target="_blank" mce_href="http://msdn.microsoft.com/en-us/library/dd183567(VS.85).aspx"&gt;BIDSection&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;I could think to 3 possible &lt;em&gt;solutions&lt;/em&gt; (in order of my preference) to this case, not all of them very nice but if nothing else can be done… if you have anything to add, feel free &lt;img alt="smile_regular" src="http://spaces.live.com/rte/emoticons/smile_regular.gif" mce_src="http://spaces.live.com/rte/emoticons/smile_regular.gif" /&gt;:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;If it is possible to move the logic to create the 3D image, the Web Service call could just return to the client the data needed to build the image and do the “hard work” in WPF either in a Windows Forms client or in &lt;a href="http://silverlight.net/" target="_blank" mce_href="http://silverlight.net/"&gt;Silverlight&lt;/a&gt; if you wish &lt;/li&gt;    &lt;li&gt;Create a sort of custom web server using the &lt;a href="http://blogs.iis.net/carlosag/archive/2008/04/14/host-your-own-web-server-in-your-application-using-iis-7-0-hostable-web-core.aspx" target="_blank" mce_href="http://blogs.iis.net/carlosag/archive/2008/04/14/host-your-own-web-server-in-your-application-using-iis-7-0-hostable-web-core.aspx"&gt;hostable web core&lt;/a&gt; provided by IIS 7, embed it into a usermode process (not in a service) and use it to run your code and serve the 3D image: this means there must be an account always logged on the server to keep this process running &lt;/li&gt;    &lt;li&gt;Rely only on “safe and simple” drawing objects or work directly with bytes structures to design your graphic “point by point”: this is the hard way of doing graphics and you’ll need to code it in C++ I think, you’ll likely have to renounce using effects such as transparencies but at least it should work &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;font color="#000080" size="3" face="Brush Script MT"&gt;&lt;/font&gt;&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;A compromise is the art of dividing a cake in such a way that everyone believes he has the biggest piece. - &lt;a href="http://en.wikipedia.org/wiki/Ludwig_Erhard" target="_blank" mce_href="http://en.wikipedia.org/wiki/Ludwig_Erhard"&gt;Ludwig Erhard&lt;/a&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9539801" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/carloc/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/carloc/archive/tags/Vista_2F00_Longhorn/default.aspx">Vista/Longhorn</category></item></channel></rss>