<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">Blog posts by Kristoffer Sjöberg</title><link href="http://world.optimizely.com" /><updated>2016-04-20T14:34:58.0000000Z</updated><id>https://world.optimizely.com/blogs/Kristoffer-Sjoberg/</id> <generator uri="http://world.optimizely.com" version="2.0">Optimizely World</generator> <entry><title>A Burst Cache implementation released</title><link href="http://blog.q1.se/?p=238" /><id>There are few things&#160;more rewarding in site performance than enabling the Output Cache. This will store the ready-generated HTML to be served without executing any WebForms pages or Controller actions and their respective Views for MVC sites. In Episerver, the output cache is enabled in the applicationSettings element&amp;#8217;s httpCacheExpiration attribute in web.config. That sets the &amp;#8230; &lt;a href=&quot;http://blog.q1.se/2016/04/20/a-burst-cache-implementation-released/&quot; class=&quot;more-link&quot;&gt;Continue reading&lt;span class=&quot;screen-reader-text&quot;&gt; &quot;A Burst Cache implementation released&quot;&lt;/span&gt;&lt;/a&gt;</id><updated>2016-04-20T14:34:58.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Methods of .NET self-annihilation part 4: Background Thread Exceptions</title><link href="http://blog.q1.se/?p=218" /><id>Death by Background Thread Exception (including ThreadPool User Work Items) If you use a thread or&#160;ThreadPool.QueueUserWorkItem&#160;to run code asynchronously and don&amp;#8217;t catch your exceptions inside your WaitCallback, you will bring your entire application down when it breaks. [crayon-580f8f3d3ab8d685111634/] On the highlighted line, a NullReferenceException is thrown (because a background thread has no HttpContext). If you &amp;#8230; &lt;a href=&quot;http://blog.q1.se/2016/03/18/methods-of-net-self-annihilation-part-4-background-thread-exceptions/&quot; class=&quot;more-link&quot;&gt;Continue reading&lt;span class=&quot;screen-reader-text&quot;&gt; &quot;Methods of .NET self-annihilation part 4: Background Thread Exceptions&quot;&lt;/span&gt;&lt;/a&gt;</id><updated>2016-03-18T11:49:32.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Methods of .NET self-annihilation part 3: Stack Overflow</title><link href="http://blog.q1.se/?p=189" /><id>This is&#160;another issue that results in Frequent Web Application Restarts, which causes the performance to plunge. Death by Stack Overflow This one is interesting, yet it&#160;has nothing to do with StackOverflow.com. The StackOverflowException is one of very few exception classes in .NET that are not catch-able. Scratch that, it&amp;#8217;s not possible to&#160;&amp;#8220;swallow&amp;#8221; it in a &amp;#8230; &lt;a href=&quot;http://blog.q1.se/2016/03/17/methods-of-net-self-annihilation-part-3-stack-overflow/&quot; class=&quot;more-link&quot;&gt;Continue reading&lt;span class=&quot;screen-reader-text&quot;&gt; &quot;Methods of .NET self-annihilation part 3: Stack Overflow&quot;&lt;/span&gt;&lt;/a&gt;</id><updated>2016-03-17T14:05:24.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Memory Leak in CMS prior to 9.0.2</title><link href="http://blog.q1.se/?p=197" /><id>This bug appears only in load-balanced / remote events setups for CMS versions between 7.5 and 9.0.2 (released September 14th 2015, in which&#160;it was fixed). It&amp;#8217;s reported as bug CMS-1405. This memory leak is relatively slow. Because of the way that ASP.NET handles cache, the application&amp;#8217;s memory allocation will remain constant while the cache portion &amp;#8230; &lt;a href=&quot;http://blog.q1.se/2016/03/14/memory-leak-in-cms-prior-to-9-0-2/&quot; class=&quot;more-link&quot;&gt;Continue reading&lt;span class=&quot;screen-reader-text&quot;&gt; &quot;Memory Leak in CMS prior to 9.0.2&quot;&lt;/span&gt;&lt;/a&gt;</id><updated>2016-03-14T16:25:24.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Methods of .NET self-annihilation part 2: IIS ping</title><link href="http://blog.q1.se/?p=184" /><id>Last post I discussed why Frequent Web Application restarts are bad. This is an issue that can&#160;cause you pain trying to get the application back up running again: Death by IIS Ping IIS&amp;#8217; built-in health monitoring is quite simple, but despite it having the word &amp;#8220;ping&amp;#8221; in its name, it has nothing to do with &amp;#8230; &lt;a href=&quot;http://blog.q1.se/2016/03/14/methods-of-net-self-annihilation-part-2-iis-ping/&quot; class=&quot;more-link&quot;&gt;Continue reading&lt;span class=&quot;screen-reader-text&quot;&gt; &quot;Methods of .NET self-annihilation part 2: IIS ping&quot;&lt;/span&gt;&lt;/a&gt;</id><updated>2016-03-14T07:20:32.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Methods of .NET self-annihilation part 1: Frequent Web Application Restarts</title><link href="http://blog.q1.se/?p=44" /><id>There are many different ways you may inadvertently kill your web application&amp;#8217;s presence online. Here I try to list the major reasons an IIS site running .NET may underperform. The trickiest cases to prevent are&#160;the&#160;time bombs. That&#160;code that runs really well in development, but starts misbehaving when put in production. Not immediately of course, but &amp;#8230; &lt;a href=&quot;http://blog.q1.se/2016/03/11/methods-of-net-self-annihilation-part-1-frequent-web-application-restarts/&quot; class=&quot;more-link&quot;&gt;Continue reading&lt;span class=&quot;screen-reader-text&quot;&gt; &quot;Methods of .NET self-annihilation part 1: Frequent Web Application Restarts&quot;&lt;/span&gt;&lt;/a&gt;</id><updated>2016-03-11T09:39:33.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Commerce: Failed to migrate property decimal: Timeout expired.</title><link href="http://blog.q1.se/?p=158" /><id>Today I was involved in&#160;an issue running the upgrade migration steps in Episerver Commerce. This step is performed if you upgrade&#160;past Episerver Commerce 9.5.0 that came with update 94. [crayon-580f8f3d3d3ad338705338/] How disappointing! Even though care has been taken in the migration step to do it in small units and with an extended SQL timeout of &amp;#8230; &lt;a href=&quot;http://blog.q1.se/2016/03/10/commerce-failed-to-migrate-property-decimal-timeout-expired/&quot; class=&quot;more-link&quot;&gt;Continue reading&lt;span class=&quot;screen-reader-text&quot;&gt; &quot;Commerce: Failed to migrate property decimal: Timeout expired.&quot;&lt;/span&gt;&lt;/a&gt;</id><updated>2016-03-10T14:21:25.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>PageTypeBuilder doesn’t cache</title><link href="http://blog.q1.se/?p=98" /><id>This is a PageTypeBuilder specific post, so it does not apply to users of CMS 7+. This post balances yesterday&amp;#8217;s post&#160;which discusses the effects of caching.&#160;This one discusses the effects of not caching. Consider the following code example: [crayon-580f8f3d3df63283616809/] See the class variable&#160;[crayon-580f8f3d3df6d496635177-i/]? The variable that stores the value retrieved from the first non-null property &amp;#8230; &lt;a href=&quot;http://blog.q1.se/2016/03/09/pagetypebuilder-doesnt-cache/&quot; class=&quot;more-link&quot;&gt;Continue reading&lt;span class=&quot;screen-reader-text&quot;&gt; &quot;PageTypeBuilder doesn&amp;#8217;t cache&quot;&lt;/span&gt;&lt;/a&gt;</id><updated>2016-03-09T08:00:08.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Rule of thumb: Never have [Ignore] properties in a ContentType/model</title><link href="http://blog.q1.se/?p=128" /><id>This applies to WebForms and MVC scenarios alike, but it&amp;#8217;s mostly MVC users that are tempted in doing it: Never put request specific data into the ContentType model class! It may sound obvious to some, and not so obvious to others. Regardless, it&amp;#8217;s an easy mistake to make. Worse is, doing it may survive development, &amp;#8230; &lt;a href=&quot;http://blog.q1.se/2016/03/08/rule-of-thumb-never-have-ignore-properties-in-a-contenttypemodel/&quot; class=&quot;more-link&quot;&gt;Continue reading&lt;span class=&quot;screen-reader-text&quot;&gt; &quot;Rule of thumb: Never have [Ignore] properties in a ContentType/model&quot;&lt;/span&gt;&lt;/a&gt;</id><updated>2016-03-08T08:00:21.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Find _config requests</title><link href="http://blog.q1.se/?p=108" /><id>The French say &amp;#8220;jamais deux sans trois&amp;#8221;. If&#160;something happens twice, it will happen again. Twice I have seen questions&#160;about why Episerver Find performs multiple/repeated requests to the Find index for its configuration (_config) when working to minimize the number of queries. Sometimes these requests are&#160;spotted when using a Performance Profiler such as the excellent one &amp;#8230; &lt;a href=&quot;http://blog.q1.se/2016/03/07/find-_config-requests/&quot; class=&quot;more-link&quot;&gt;Continue reading&lt;span class=&quot;screen-reader-text&quot;&gt; &quot;Find _config requests&quot;&lt;/span&gt;&lt;/a&gt;</id><updated>2016-03-07T10:00:31.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>.NET 4 Linq Expression Lock Convoy</title><link href="http://blog.q1.se/?p=46" /><id>A few months&#160;ago, I was involved in a performance case involving an old CMS6R2 site. They explained that the site seemed to go down for a couple of minutes, to then automatically recover. During the downtime, any browser connecting to the site would be spinning at &amp;#8220;Waiting for reply&amp;#8230;&amp;#8221; and this could potentially go on &amp;#8230; &lt;a href=&quot;http://blog.q1.se/2016/03/04/net-4-linq-expression-lock-convoy/&quot; class=&quot;more-link&quot;&gt;Continue reading&lt;span class=&quot;screen-reader-text&quot;&gt; &quot;.NET 4 Linq Expression Lock Convoy&quot;&lt;/span&gt;&lt;/a&gt;</id><updated>2016-03-04T09:22:34.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>The Large Object Heap and why you should know about it</title><link href="http://blog.q1.se/?p=48" /><id>To write an application, you don&amp;#8217;t have to know very much about how .NET manages memory. To write an application that&#160;performs, it will&#160;be crucial. In this post I will focus on the memory management / Garbage Collection aspects of a .NET application. &#160;Too many times when I&#160;have been&#160;thrown into a performance troubleshooting case, I have &amp;#8230; &lt;a href=&quot;http://blog.q1.se/2016/03/02/the-large-object-heap-and-why-you-should-know-about-it/&quot; class=&quot;more-link&quot;&gt;Continue reading&lt;span class=&quot;screen-reader-text&quot;&gt; &quot;The Large Object Heap and why you should know about it&quot;&lt;/span&gt;&lt;/a&gt;</id><updated>2016-03-02T15:46:29.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Castle.Core lock contention issue</title><link href="http://blog.q1.se/?p=20" /><id>A while back, a customer reported that their site&amp;#8217;s performance was very &amp;#8220;stop and go&amp;#8221;. Suddenly, it would just stop delivering web pages. Neither the database, web servers nor any other infrastructure components seemed to be experiencing any stress. I asked them to use my colleague Mattias L&#246;vstr&#246;m&amp;#8217;s excellent StackDump tool when the site was &amp;#8230; &lt;a href=&quot;http://blog.q1.se/2016/03/01/castle-core-lock-contention-issue/&quot; class=&quot;more-link&quot;&gt;Continue reading&lt;span class=&quot;screen-reader-text&quot;&gt; &quot;Castle.Core lock contention issue&quot;&lt;/span&gt;&lt;/a&gt;</id><updated>2016-03-01T10:09:57.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Troubleshooting a problem with POST-requests in an environment with mixed NTLM and Forms authentication</title><link href="https://world.optimizely.com/blogs/Kristoffer-Sjoberg/Dates/2014/7/Troubleshooting-a-problem-with-POST-requests-in-an-environment-with-mixed-NTLM-and-Forms-authentication/" /><id>&lt;p&gt;In most Intranet solutions there’s a desire to make the users of the Intranet be able to use the Intranet without logging in. This can be done in many ways, but this blog post takes one particular solution and takes a closer look at it.    &lt;br /&gt;The partner had created a special FormsAuthentication module to replace the standard ASP.NET &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.web.security.formsauthenticationmodule.aspx&quot; target=&quot;_blank&quot;&gt;FormsAuthentication module&lt;/a&gt;. Using some reflection it piggybacked on the OnEnter and OnLeave private method implementations in that module to copy the normal FormsAuthentication behavior that redirects the user to a login page if the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.web.security.formsauthenticationticket(v=vs.110).aspx&quot; target=&quot;_blank&quot;&gt;authentication ticket&lt;/a&gt; is not among the user’s cookies.&lt;/p&gt;    &lt;p&gt;As a part of the setup of this module, two virtual paths had been created whose requests were captured by a special module. One of those paths was reconfigured using a &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/b6x6shw7(v=vs.100).aspx&quot; target=&quot;_blank&quot;&gt;web.config location element&lt;/a&gt; to add a &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/532aee0e(v=vs.100).aspx&quot; target=&quot;_blank&quot;&gt;authentication element&lt;/a&gt; that specified that that path expects the user to authenticate using &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/aa720716(v=vs.71).aspx&quot; target=&quot;_blank&quot;&gt;Windows authentication&lt;/a&gt;.&lt;/p&gt;    &lt;p&gt;The two paths were &lt;strong&gt;/WindowsLogin&lt;/strong&gt; (configured with Windows authentication) and &lt;strong&gt;/Authenticate&lt;/strong&gt; (configured using Forms authentication).&lt;/p&gt;    &lt;p&gt;When the user was decided to be unauthenticated, the normal behavior of the Forms authentication module is to redirect the user to the login page. In this case it was configured to be &lt;strong&gt;/WindowsLogin &lt;/strong&gt;(see &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/1d3t3c61(v=vs.100).aspx&quot; target=&quot;_blank&quot;&gt;loginUrl in the documentation&lt;/a&gt;). When that Url was successfully executed, the server side code would issue a forms authentication ticket with the credentials the user (or web browser) supplied. In the Intranet zone, Internet Explorer attempts an NTLM/Negotiate based authentication automatically, so no login is required. On failure, the normal forms authentication screen would present via a redirect to &lt;strong&gt;/Authenticate&lt;/strong&gt;.&lt;/p&gt;    &lt;p&gt;The solution mostly worked, but there were some problems in critical areas of the web site. Notably, postback-requests would occasionally render as non-postbacks. This is particularly bad when that postback contain information the user has spent much time creating. Typical case would be the user creating a new page or editing an existing page. After about one minute from the moment the page was downloaded, the save action would simply reload the page.    &lt;br /&gt;    &lt;br /&gt;After some troubleshooting we concluded that the problem occurred because Internet Explorer believed that all pages on the intranet was protected with NTLM/Negotiate. It basically means that at each new connection made, ​​the client is required to authenticate itself. HTTP Keep-alives allows a web browser to establish a single connection and then reuse it until the connection is closed. The idle timeout of keep alives in this environment was one minute.&lt;/p&gt;  &lt;p&gt;It is done by a (simplified below) four step process: &lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;The browser sends a request for the protected resource, eg / episerver. &lt;/li&gt;    &lt;li&gt;The server responds 401 Unauthorized and provides a &amp;quot;NTLM challenge&amp;quot; to the browser. &lt;/li&gt;    &lt;li&gt;The browser computes a response to the server&#39;s given challenge and sends the response along with a new request for the protected resource. &lt;/li&gt;    &lt;li&gt;The server answers confirms the answer to the authentication and if it went well the server responds with 200 OK and process requests in full. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;In step 1, the browser omits to send the POST data (the data entered in form fields on the page), as it is certain that the server will reply &amp;quot;401 Unauthenticated&amp;quot; and ignore the POST data so it would be pointless to send it. In step 3, the browser includes the POST data.&lt;/p&gt;  &lt;p&gt;Since the server and the browser has different ideas of ​​what resources are protected with NTLM/Negotiate, this creates a conflict. The browser a expects a 401 response to resources protected by NTLM where the connection is not yet authenticated, but the server satisfies itself with the Forms Authentication ticket in the set of cookies sent by the client. This allows the server to act on a POST request without receiving the POST data (as it is omitted in step 1 of NTLM authentication), and then we will get the effect we saw - the &amp;quot;reloaded page&amp;quot; with emptied of form data. &lt;/p&gt;  &lt;p&gt;The solution was to add the NTLM / Negotiate protected resources in a virtual directory, eg &lt;strong&gt;/AuthenticationSubSystem/WindowsLogin&lt;/strong&gt;, so that the browser think it&#39;s just the resources in that directory that requires NTLM/Negotiate authentication. The other resources are handled by the browser as usual. Previously the NTLM protected resources resided directly in the root which made the browser assume that other resources under the root and its subdirectories are protected with NTLM.&lt;/p&gt;</id><updated>2014-07-17T16:56:58.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Using ADPlus to create dumps on a specific .NET exception</title><link href="https://world.optimizely.com/blogs/Kristoffer-Sjoberg/Dates/2011/4/Using-ADPlus-to-create-dumps-on-a-specific-NET-exception/" /><id>&lt;p&gt;Sometimes an application throws an exception and you need to have a look at the environment to be able to find the cause of the exception. To do this, it is convenient if it would be possible to capture a snapshot of the process precisely at the point when the exception is thrown.&lt;/p&gt;  &lt;p&gt;The example at hand is an issue where a customer reported that the application threw an &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.argumentexception.aspx&quot; target=&quot;_blank&quot;&gt;ArgumentException&lt;/a&gt;:&lt;/p&gt;  &lt;p&gt;&lt;code&gt;ArgumentException: &#39;&#39;, hexadecimal value 0x1B, is an invalid character.]      &lt;br /&gt;&amp;#160;&amp;#160; System.Xml.XmlEncodedRawTextWriter.InvalidXmlChar(Int32 ch, Char* pDst, Boolean entitize) +1702938       &lt;br /&gt;&amp;#160;&amp;#160; System.Xml.XmlEncodedRawTextWriter.WriteElementTextBlock(Char* pSrc, Char* pSrcEnd) +493       &lt;br /&gt;&amp;#160;&amp;#160; System.Xml.XmlEncodedRawTextWriter.WriteString(String text) +88       &lt;br /&gt;&amp;#160;&amp;#160; System.Xml.XmlWellFormedWriter.WriteString(String text) +87       &lt;br /&gt;&amp;#160;&amp;#160; System.Xml.XmlWrappedWriter.WriteString(String text) +15       &lt;br /&gt;&amp;#160;&amp;#160; System.ServiceModel.Syndication.TextSyndicationContent.WriteContentsTo(XmlWriter writer) +62       &lt;br /&gt;&amp;#160;&amp;#160; System.ServiceModel.Syndication.SyndicationContent.WriteTo(XmlWriter writer, String outerElementName, String outerElementNamespace) +430       &lt;br /&gt;&amp;#160;&amp;#160; System.ServiceModel.Syndication.Atom10FeedFormatter.WriteItemContents(XmlWriter dictWriter, SyndicationItem item, Uri feedBaseUri) +840       &lt;br /&gt;&amp;#160;&amp;#160; System.ServiceModel.Syndication.Atom10ItemFormatter.WriteItem(XmlWriter writer) +42       &lt;br /&gt;&amp;#160;&amp;#160; System.ServiceModel.Syndication.Atom10ItemFormatter.WriteTo(XmlWriter writer) +58       &lt;br /&gt;&amp;#160;&amp;#160; EPiServer.Search.IndexItemBase.ToSyndicationItemXml() +4104       &lt;br /&gt;&amp;#160;&amp;#160; EPiServer.Search.IndexRequestItem.ToSyndicationItemXml() +139       &lt;br /&gt;&amp;#160;&amp;#160; EPiServer.Search.Data.SearchFactory.AddToQueue(IndexRequestItem item, String namedIndexingService) +117       &lt;br /&gt;&amp;#160;&amp;#160; EPiServer.Search.SearchHandler.UpdateIndex(IndexRequestItem item, String namedIndexingService) +70       &lt;br /&gt;&amp;#160;&amp;#160; EPiServer.Community.Search.SearchHandler.UpdateIndex(Int32 entityId, IEntity entity, IndexAction action) +312       &lt;br /&gt;&amp;#160;&amp;#160; EPiServer.Community.Search.SearchHandler.AddEntitiesToIndex(GetCollection getCollection, Boolean overwrite) +233       &lt;br /&gt;&amp;#160;&amp;#160; EPiServer.Community.Search.SearchHandler.AddCommunityEntitiesToIndex(Type type, Boolean overwrite) +1536       &lt;br /&gt;&amp;#160;&amp;#160; EPiServer.Community.Search.SearchHandler.AddCommunityEntitiesToIndex(Boolean overwrite) +20&lt;/code&gt;&lt;/p&gt;  &lt;p&gt;Interpreting the exception, we know that the problem occurs during the indexing of some community entity. However, the stack trace leaves us no hint of &lt;em&gt;which&lt;/em&gt; entity, nor the field that contain the 0x1B character that the XML writer class is unable to handle.&lt;/p&gt;  &lt;p&gt;Again, &lt;a href=&quot;http://msdn.microsoft.com/en-us/windows/hardware/gg463009&quot; target=&quot;_blank&quot;&gt;Debugging Tools for Windows&lt;/a&gt; comes to the rescue. This time, I&#39;ll show you how to use &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ff537953.aspx&quot; target=&quot;_blank&quot;&gt;ADPlus&lt;/a&gt; to attach to a process and perform a dump each time an &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.argumentexception.aspx&quot; target=&quot;_blank&quot;&gt;ArgumentException&lt;/a&gt; is thrown.&lt;/p&gt;  &lt;p&gt;Create a file, let&#39;s call it &amp;quot;dump-on-argumentexception.cfg&amp;quot;, with the following content:&lt;/p&gt;  &lt;pre style=&quot;border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 100%; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px&quot;&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;ADPlus&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 12px&quot;&gt;    &lt;span style=&quot;color: #008000&quot;&gt;&amp;lt;!-- Configuring ADPlus to log only exceptions we&#39;re interested in --&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 12px&quot;&gt;  &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;Exceptions&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 12px&quot;&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;Config&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 12px&quot;&gt;        &lt;span style=&quot;color: #008000&quot;&gt;&amp;lt;!-- This is for the CLR exception --&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 12px&quot;&gt;       &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;Code&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt; clr &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;Code&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 12px&quot;&gt;       &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;Actions1&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt; Log &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;Actions1&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 12px&quot;&gt;       &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;CustomActions1&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt; .loadby sos mscorwks; !StopOnException System.ArgumentException 1; j ($t1 = 1) &#39;.dump /ma /u ArgumentException.dmp; gn&#39; ; &#39;gn&#39;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;CustomActions1&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 12px&quot;&gt;       &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;ReturnAction1&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt; VOID  &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;ReturnAction1&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 12px&quot;&gt;       &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;Actions2&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt; Log &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;Actions2&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 12px&quot;&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;Config&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 12px&quot;&gt;  &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;Exceptions&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;ADPlus&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Note that when you&#39;re troubleshooting a .NET 4 process&lt;/strong&gt;, you need to replace &amp;quot;.loadby sos mscorwks&amp;quot; with &amp;quot;.loadby sos clr&amp;quot; in the CustomActions1-element of the configuration above.&lt;/p&gt;

&lt;p&gt;Then, invoke ADPlus with the following set of parameters.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;C:\Program Files (x86)\Debugging Tools for Windows (x86)&amp;gt;cscript adplus.vbs -crash –p &amp;lt;PID&amp;gt; -FullOnFirst –c dump-on-argumentexception.cfg&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Replace &amp;lt;PID&amp;gt; with the process ID you want to monitor, for example the w3wp.exe. ADPlus will launch, attach a console debugger to the process and take a memory dump each time the process throws an ArgumentException, even if it&#39;s handled (try/catched).&lt;/p&gt;

&lt;h2&gt;Debugging the created memory dump(s)&lt;/h2&gt;

&lt;p&gt;Open up WinDbg, and select File-&amp;gt;Open Crash Dump... Navigate to one of the created dumps.&lt;/p&gt;

&lt;p&gt;Load the .NET debugging extension:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;0:020&amp;gt; .loadby sos mscorwks&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Note the 0:020? This is WinDbg&#39;s syntax of telling us which process:thread is currently active. In dumps with an active exception on one of its threads, WinDbg will automatically switch to the thread with the exception.&lt;/p&gt;

&lt;p&gt;Now, to see the stack trace including all available parameters and local variables, issue the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;0:020&amp;gt; !clrstack –a 
    &lt;br /&gt;OS Thread Id: 0xdd1c (20) 

    &lt;br /&gt;ESP&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; EIP&amp;#160; &lt;br /&gt;0b8ff600 66083e1c System.Web.HttpRuntime.ProcessRequestInternal(System.Web.HttpWorkerRequest) 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; PARAMETERS: 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; this = 0x02611d4c 

    &lt;br /&gt;... 

    &lt;br /&gt;...&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Given this information, you may call SOS&#39; !DumpObject command (&amp;quot;!do&amp;quot; for short) to examine the contents of &lt;em&gt;&#39;this&#39;&lt;/em&gt; or any other parameter that are still available (release mode binaries often optimize them away), and !DumpStackObjects (&amp;quot;!dso&amp;quot; for short) to enumerate all objects on the stack.&lt;/p&gt;

&lt;p&gt;Unfortunately, I don&#39;t have a memory dump that is perfectly suitable to demonstrate this. An out-of-context example would be this examination of the &lt;a href=&quot;http://sdk.episerver.com/library/cms6.1/html/T_EPiServer_Core_LanguageManager.htm&quot; target=&quot;_blank&quot;&gt;LanguageManager&lt;/a&gt;&#39;s &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx&quot; target=&quot;_blank&quot;&gt;FileSystemWatcher&lt;/a&gt; instance on the current thread.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;0:020:x86&amp;gt; !dso 
    &lt;br /&gt;OS Thread Id: 0x1524 (20) 

    &lt;br /&gt;ESP/REG&amp;#160; Object&amp;#160;&amp;#160; Name 

    &lt;br /&gt;000000000f16a624 &lt;b style=&quot;background-color: #ffff00&quot;&gt;000000000358c1d4&lt;/b&gt; System.IO.FileSystemWatcher 

    &lt;br /&gt;000000000f16a67c 000000000358c1d4 System.IO.FileSystemWatcher 

    &lt;br /&gt;000000000f16a690 000000000358c1d4 System.IO.FileSystemWatcher 

    &lt;br /&gt;000000000f16a694 000000000358c1d4 System.IO.FileSystemWatcher 

    &lt;br /&gt;000000000f16a6f8 000000000358c1d4 System.IO.FileSystemWatcher 

    &lt;br /&gt;000000000f16a714 000000000358c1d4 System.IO.FileSystemWatcher 

    &lt;br /&gt;000000000f16a730 000000000358c1d4 System.IO.FileSystemWatcher 

    &lt;br /&gt;000000000f16a740 000000000358c1d4 System.IO.FileSystemWatcher 

    &lt;br /&gt;000000000f16a750 000000000358c030 EPiServer.Core.LanguageManager 

    &lt;br /&gt;000000000f16a75c 000000000358c030 EPiServer.Core.LanguageManager 

    &lt;br /&gt;000000000f16a768 000000000358bf28 System.Object 

    &lt;br /&gt;000000000f16a7a0 000000000357f0f4 EPiServer.Web.InitializeEngine+ActionState 

    &lt;br /&gt;000000000f16a7a4 000000000357ec8c EPiServer.Web.InitializeEngine 

    &lt;br /&gt;

    &lt;br /&gt;0:020:x86&amp;gt; !do &lt;b style=&quot;background-color: #ffff00&quot;&gt;000000000358c1d4&lt;/b&gt; 

    &lt;br /&gt;Name: System.IO.FileSystemWatcher 

    &lt;br /&gt;MethodTable: 000000000a2de9a4 

    &lt;br /&gt;EEClass: 000000000adb82b0 

    &lt;br /&gt;Size: 92(0x5c) bytes 

    &lt;br /&gt;(C:\windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll) 

    &lt;br /&gt;Fields: 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; MT&amp;#160;&amp;#160;&amp;#160; Field&amp;#160;&amp;#160; Offset&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Type VT&amp;#160;&amp;#160;&amp;#160;&amp;#160; Attr&amp;#160;&amp;#160;&amp;#160; Value Name 

    &lt;br /&gt;0000000060ad078c&amp;#160; 400018a&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.Object&amp;#160; 0 instance 0000000000000000 __identity 

    &lt;br /&gt;000000000a2dc594&amp;#160; 40008e0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 8 ...ponentModel.ISite&amp;#160; 0 instance 0000000000000000 site 

    &lt;br /&gt;000000000ae0b3a4&amp;#160; 40008e1&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; c ....EventHandlerList&amp;#160; 0 instance 0000000000000000 events 

    &lt;br /&gt;0000000060ad078c&amp;#160; 40008df&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 108&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.Object&amp;#160; 0&amp;#160;&amp;#160; static 000000001365be64 EventDisposed 

    &lt;br /&gt;0000000060ad0b70&amp;#160; 400315f&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 10&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.String&amp;#160; 0 instance &lt;b style=&quot;background-color: #ffff00&quot;&gt;000000000358c044&lt;/b&gt; directory 

    &lt;br /&gt;0000000060ad0b70&amp;#160; 4003160&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 14&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.String&amp;#160; 0 instance 000000000358c098 filter 

    &lt;br /&gt;0000000060aceb3c&amp;#160; 4003161&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 18 ...es.SafeFileHandle&amp;#160; 0 instance 0000000000000000 directoryHandle 

    &lt;br /&gt;000000000a2de708&amp;#160; 4003162&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 34&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.Int32&amp;#160; 1 instance&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 81 notifyFilters 

    &lt;br /&gt;0000000060aa463c&amp;#160; 4003163&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 40&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.Boolean&amp;#160; 1 instance&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0 includeSubdirectories 

    &lt;br /&gt;0000000060aa463c&amp;#160; 4003164&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 41&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.Boolean&amp;#160; 1 instance&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0 enabled 

    &lt;br /&gt;0000000060aa463c&amp;#160; 4003165&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 42&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.Boolean&amp;#160; 1 instance&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0 initializing 

    &lt;br /&gt;0000000060ad2dbc&amp;#160; 4003166&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 38&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.Int32&amp;#160; 1 instance&amp;#160;&amp;#160;&amp;#160;&amp;#160; 8192 internalBufferSize 

    &lt;br /&gt;000000000a2de93c&amp;#160; 4003167&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 48 ...tForChangedResult&amp;#160; 1 instance 000000000358c21c changedResult 

    &lt;br /&gt;0000000060aa463c&amp;#160; 4003168&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 43&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.Boolean&amp;#160; 1 instance&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0 isChanged 

    &lt;br /&gt;00000000084dd30c&amp;#160; 4003169&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1c ...SynchronizeInvoke&amp;#160; 0 instance 0000000000000000 synchronizingObject 

    &lt;br /&gt;0000000060aa463c&amp;#160; 400316a&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 44&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.Boolean&amp;#160; 1 instance&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0 readGranted 

    &lt;br /&gt;0000000060aa463c&amp;#160; 400316b&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 45&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.Boolean&amp;#160; 1 instance&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1 disposed 

    &lt;br /&gt;0000000060ad2dbc&amp;#160; 400316c&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3c&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.Int32&amp;#160; 1 instance&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2 currentSession 

    &lt;br /&gt;000000000a2deb5c&amp;#160; 400316d&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 20 ...ystemEventHandler&amp;#160; 0 instance 0000000000000000 onChangedHandler 

    &lt;br /&gt;000000000a2deb5c&amp;#160; 400316e&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 24 ...ystemEventHandler&amp;#160; 0 instance 0000000000000000 onCreatedHandler 

    &lt;br /&gt;000000000a2deb5c&amp;#160; 400316f&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 28 ...ystemEventHandler&amp;#160; 0 instance 0000000000000000 onDeletedHandler 

    &lt;br /&gt;000000000a2dec40&amp;#160; 4003170&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2c ...namedEventHandler&amp;#160; 0 instance 0000000000000000 onRenamedHandler 

    &lt;br /&gt;000000000a2dfd74&amp;#160; 4003171&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 30 ...ErrorEventHandler&amp;#160; 0 instance 0000000000000000 onErrorHandler 

    &lt;br /&gt;0000000060aa463c&amp;#160; 4003172&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 46&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.Boolean&amp;#160; 1 instance&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1 stopListening 

    &lt;br /&gt;0000000060aa463c&amp;#160; 4003173&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 47&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.Boolean&amp;#160; 1 instance&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0 runOnce 

    &lt;br /&gt;0000000060ad17a0&amp;#160; 4003174&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; bc0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.Char[]&amp;#160; 0&amp;#160;&amp;#160; static 000000001366d540 wildcards 

    &lt;br /&gt;0000000060ad2dbc&amp;#160; 4003175&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; b08&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.Int32&amp;#160; 1&amp;#160;&amp;#160; static&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 383 notifyFiltersValidMask 

    &lt;br /&gt;0:020:x86&amp;gt; !do &lt;b style=&quot;background-color: #ffff00&quot;&gt;000000000358c044&lt;/b&gt; 

    &lt;br /&gt;Name: System.String 

    &lt;br /&gt;MethodTable: 0000000060ad0b70 

    &lt;br /&gt;EEClass: 000000006088d66c 

    &lt;br /&gt;Size: 82(0x52) bytes 

    &lt;br /&gt;(C:\windows\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll) 

    &lt;br /&gt;String: &lt;b style=&quot;background-color: #ffff00&quot;&gt;C:\EPiServer\Sites\composer\lang&lt;/b&gt; 

    &lt;br /&gt;Fields: 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; MT&amp;#160;&amp;#160;&amp;#160; Field&amp;#160;&amp;#160; Offset&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Type VT&amp;#160;&amp;#160;&amp;#160;&amp;#160; Attr&amp;#160;&amp;#160;&amp;#160; Value Name 

    &lt;br /&gt;0000000060ad2dbc&amp;#160; 4000096&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.Int32&amp;#160; 1 instance&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 33 m_arrayLength 

    &lt;br /&gt;0000000060ad2dbc&amp;#160; 4000097&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 8&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.Int32&amp;#160; 1 instance&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 32 m_stringLength 

    &lt;br /&gt;0000000060ad1850&amp;#160; 4000098&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; c&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.Char&amp;#160; 1 instance&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 43 m_firstChar 

    &lt;br /&gt;0000000060ad0b70&amp;#160; 4000099&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 10&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.String&amp;#160; 0&amp;#160;&amp;#160; shared&amp;#160;&amp;#160; static Empty 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;gt;&amp;gt; Domain:Value&amp;#160; 0000000000798d20:00000000025b1198 0000000007f817e0:00000000025b1198 0000000007f81ca8:00000000025b1198 &amp;lt;&amp;lt; 

    &lt;br /&gt;0000000060ad17a0&amp;#160; 400009a&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 14&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.Char[]&amp;#160; 0&amp;#160;&amp;#160; shared&amp;#160;&amp;#160; static WhitespaceChars 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;gt;&amp;gt; Domain:Value&amp;#160; 0000000000798d20:00000000025b1788 0000000007f817e0:000000000266e0e0 0000000007f81ca8:00000000035a0794 &amp;lt;&amp;lt; 

    &lt;/code&gt;&lt;/p&gt;</id><updated>2011-04-14T13:16:29.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Debugging a 64-bit dump of a 32-bit managed process</title><link href="https://world.optimizely.com/blogs/Kristoffer-Sjoberg/Dates/2011/4/Debugging-a-64-bit-dump-of-a-32-bit-managed-process/" /><id>&lt;p&gt;You may wonder: why on earth would you want to do that? Well, on 64-bit machines, 32-bit processes are run using a &lt;a href=&quot;http://en.wikipedia.org/wiki/WOW64&quot; target=&quot;_blank&quot;&gt;WOW64&lt;/a&gt; compatibility layer to provide the 32-bit process with the appropriate entry-points and map them to the 64-bit equivalents.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/link/816929d4c75b4e23879d7b49ab720735.png&quot;&gt;&lt;img style=&quot;background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;&quot; title=&quot;image&quot; src=&quot;/link/3c2851347fdc4470823a9632873349ed.png&quot; border=&quot;0&quot; alt=&quot;image&quot; width=&quot;116&quot; height=&quot;244&quot; align=&quot;right&quot; /&gt;&lt;/a&gt;However, when you use Windows Vista&#39;s (and later) &lt;strong&gt;Create Dump File&lt;/strong&gt;, you will create a dump of the process that includes the WOW64 compatibility layer. The dump file thus contain both 64-bit and 32-bit code.&lt;/p&gt;
&lt;p&gt;If you open this dump in WinDbg (x64), it seems to load just fine. Then, to start managed debugging, you will want to load the debugging extension &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/bb190764.aspx&quot; target=&quot;_blank&quot;&gt;SOS&lt;/a&gt;. A convenient command to load the correct version of SOS (which must be the same version as the version of .NET Framework that you intend to debug) is to type the command&lt;/p&gt;
&lt;p&gt;&lt;code&gt;.loadby sos mscorwks&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;into the WinDbg command window. This will load SOS.dll from the same directory on your local machine, as mscorwks.dll was loaded from (in the debugee). (Note that you will need to exchange mscorwks with clr to debug a .NET4 debugee)&lt;/p&gt;
&lt;p&gt;However, in this case you will get errors such as:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;0:000&amp;gt; .loadby sos mscorwks      &lt;br /&gt;The call to LoadLibrary(C:\Windows\Microsoft.NET\Framework\v2.0.50727\sos) failed, Win32 error 0n193       &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &quot;%1 is not a valid Win32 application.&quot;       &lt;br /&gt;Please check your debugger configuration and/or network access.&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;There is some interesting information we can derive from this error message. Since the path (C:\Windows\Microsoft.NET\Framework) points to the 32-bit version of SOS.dll, the mscorwks.dll in the dump must also be a 32-bit binary (the 64-bit version of .NET Framework is in the Framework64 folder). And since we&#39;re running the 64-bit version of WinDbg and we try to load a 32-bit SOS, we will need to start a compatible version of WinDbg instead.&lt;/p&gt;
&lt;p&gt;Reopening the dump in WinDbg (x86) and loading the SOS managed debugging extension works just fine. However, you will find that it doesn&#39;t work when you issue any of the SOS commands: !CLRStack, !DumpHeap, !EEStack:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;0:000&amp;gt; !clrstack      &lt;br /&gt;Failed to load data access DLL, 0x80004005       &lt;br /&gt;Verify that 1) you have a recent build of the debugger (6.2.14 or newer)       &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2) the file mscordacwks.dll that matches your version of mscorwks.dll is       &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; in the version directory       &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3) or, if you are debugging a dump file, verify that the file       &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mscordacwks_&amp;lt;arch&amp;gt;_&amp;lt;arch&amp;gt;_&amp;lt;version&amp;gt;.dll is on your symbol path.       &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4) you are debugging on the same architecture as the dump file.       &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For example, an IA64 dump file must be debugged on an IA64       &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; machine.       &lt;br /&gt;You can also run the debugger command .cordll to control the debugger&#39;s       &lt;br /&gt;load of mscordacwks.dll.&amp;nbsp; .cordll -ve -u -l will do a verbose reload.       &lt;br /&gt;If that succeeds, the SOS command should work on retry.       &lt;br /&gt;If you are debugging a minidump, you need to make sure that your executable       &lt;br /&gt;path is pointing to mscorwks.dll as well.       &lt;br /&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Drats!&lt;/p&gt;
&lt;p&gt;There&#39;s a workaround for this, though. Issue the command&lt;/p&gt;
&lt;p&gt;&lt;code&gt;0:000&amp;gt; !wow64exts.sw      &lt;br /&gt;Switched to 32bit mode&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;And voila!&lt;/p&gt;
&lt;p&gt;&lt;code&gt;0:000:x86&amp;gt; !clrstack      &lt;br /&gt;OS Thread Id: 0x1b40 (0)       &lt;br /&gt;Failed to start stack walk: 80070057&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Another failure...&lt;/p&gt;
&lt;p&gt;However, other commands have started to work! Among them EEStack which prints the stack trace for all active threads, with managed and unmanaged code interleaved. This will have to do.&lt;/p&gt;
&lt;p&gt;If you&#39;re able, capture dumps of 32-bit processes with a 32-bit debugger such as the 32-bit ADPlus part of the x86 version of &lt;a href=&quot;http://msdn.microsoft.com/en-us/windows/hardware/gg463009&quot; target=&quot;_blank&quot;&gt;Debugging Tools for Windows&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Happy debugging!&lt;/p&gt;</id><updated>2011-04-13T14:30:00.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Symbols published for products in the R2 wave 2011</title><link href="https://world.optimizely.com/blogs/Kristoffer-Sjoberg/Dates/2011/4/Symbols-published-for-products-in-the-R2-wave-2011/" /><id>&lt;p&gt;The debugging symbols for the second release of EPiServer CMS, Community, Mail, Composer and Commerce have now been published on &lt;a href=&quot;http://symbols.episerver.com/&quot;&gt;http://symbols.episerver.com/&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Let me show you how to set up a few common debuggers to automatically download symbols from our store.&lt;/p&gt;
&lt;h3&gt;Visual Studio 2008/2010&lt;/h3&gt;
&lt;p&gt;Open up the Tools menu, and select Options… In the dialog that appears, open “Debugging” and select Symbols. Here, enter our symbol server location and a local directory for the symbol cache.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/link/4f5021661cb34433bb9f67df1cf416bc.png&quot;&gt;&lt;img style=&quot;background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;&quot; title=&quot;image&quot; src=&quot;/link/48dcf7c1cfb34be7814533829cf1fb0c.png&quot; border=&quot;0&quot; alt=&quot;image&quot; width=&quot;471&quot; height=&quot;272&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;With the symbols, the Call Stack window now displays a little bit more information:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/link/6db1329f0da5493384274111423c72be.png&quot;&gt;&lt;img style=&quot;background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;&quot; title=&quot;image&quot; src=&quot;/link/d6fde01fae43443ab7bba59bc34e32b2.png&quot; border=&quot;0&quot; alt=&quot;image&quot; width=&quot;474&quot; height=&quot;233&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;How to download the symbols for a set of EPiServer DLLs&lt;/h3&gt;
&lt;p&gt;With the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ff558844%28v=vs.85%29.aspx&quot;&gt;symchk.exe&lt;/a&gt; tool, which is a part of &lt;a href=&quot;http://msdn.microsoft.com/en-us/windows/hardware/gg463009&quot;&gt;Debugging Tools for Windows&lt;/a&gt;, you may obtain the symbols for a set of DLLs on your local machine. This is how you can download the EPiServer symbols for a web application.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Make sure you have &lt;a href=&quot;http://msdn.microsoft.com/en-us/windows/hardware/gg463009&quot;&gt;Debugging Tools for Windows&lt;/a&gt; installed &lt;/li&gt;
&lt;li&gt;Open up a command prompt in the directory that contain the EPiServer DLLs whose symbols you want to obtain. &lt;/li&gt;
&lt;li&gt;Run the command &lt;span style=&quot;font-family: Lucida Console;&quot;&gt;&quot;\Program Files\Debugging Tools for Windows (x86)\symchk.exe&quot; *.dll /s SRV*&lt;/span&gt;&lt;a href=&quot;http://symbols.episerver.com/&quot;&gt;&lt;span style=&quot;font-family: Lucida Console;&quot;&gt;http://symbols.episerver.com/&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Lucida Console;&quot;&gt; /oc .        &lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;You may need to adjust the path to the symchk.exe tool depending on your CPU architecture. &lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;The parameter “*.dll” specifies that symbols for all DLLs in the current directory should be requested from the symbol server. The next parameter, &lt;span style=&quot;font-family: Lucida Console;&quot;&gt;/s SRV*http://symbols.episerver.com/&lt;/span&gt;, specifies which symbol path to use. The last parameter, &lt;span style=&quot;font-family: Lucida Console;&quot;&gt;/oc .&lt;/span&gt; tells the symchk.exe tool to output all the downloaded symbols to the current directory (alongside the DLLs).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;A typical AlloyTech bin folder looks like this just after the installation:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/link/d3f6086498104fbbaa8ad7d95cc943c9.png&quot;&gt;&lt;img style=&quot;background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;&quot; title=&quot;image&quot; src=&quot;/link/fc949d87452a4eae99fd755d2e68f6d7.png&quot; border=&quot;0&quot; alt=&quot;image&quot; width=&quot;484&quot; height=&quot;398&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Using the symchk.exe tool, the symbols are downloaded from EPiServer’s symbol server to the current folder.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/link/a2a828cc145c49d2b07bda4c0f93901b.png&quot;&gt;&lt;img style=&quot;background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;&quot; title=&quot;image&quot; src=&quot;/link/c254fc01e2d6495f8ecace12b41f5293.png&quot; border=&quot;0&quot; alt=&quot;image&quot; width=&quot;488&quot; height=&quot;158&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;After the command has finished executing, the bin folder of the site have been populated with PDBs for all binaries that matched a symbol on our symbol server.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/link/f574cdf8d03d4776a1e4fbcf2cfbac0d.png&quot;&gt;&lt;img style=&quot;background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;&quot; title=&quot;image&quot; src=&quot;/link/d1aec30caa1c4b6fb1e5b790ff0ee3b7.png&quot; border=&quot;0&quot; alt=&quot;image&quot; width=&quot;515&quot; height=&quot;426&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Configuring WinDBG&lt;/h3&gt;
&lt;p&gt;Usually, you configure WinDBG’s symbol search path to include Microsoft’s Symbol Server. You may add EPiServer’s symbol store too, and search it as well as Microsoft’s symbol store. Just include &lt;span style=&quot;font-family: Lucida Console;&quot;&gt;SRV*C:\Symbols*http://symbols.episerver.com/ &lt;/span&gt;in the Symbol Search Path. Separate multiple entries with semi-colon.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/link/8db2efb651aa48999fe7ce8e44192bb0.png&quot;&gt;&lt;img style=&quot;background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;&quot; title=&quot;image&quot; src=&quot;/link/4823785194514a2ab81242bbae47dec0.png&quot; border=&quot;0&quot; alt=&quot;image&quot; width=&quot;512&quot; height=&quot;237&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Happy debugging!&lt;/p&gt;</id><updated>2011-04-11T13:12:00.0000000Z</updated><summary type="html">Blog post</summary></entry></feed>