<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Web Technology Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/puneetgupta/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/puneetgupta/feed.xml</link>
    <description>Blog on IIS, ASP.NET and Azure App Service technologies</description>
    <lastBuildDate>Tue, 06 Jun 2017 14:42:26 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Azure App Service - What is taking my disk space for my Azure Web App ?</title>
      <link>https://docs.microsoft.com/archive/blogs/puneetgupta/azure-app-service-what-is-taking-my-disk-space-for-my-azure-web-app</link>
      <pubDate>Tue, 06 Jun 2017 08:58:23 GMT</pubDate>
      <dc:creator><![CDATA[PuneetG]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/puneetgupta/?p=195</guid>
      <description><![CDATA[While working on Azure App service, you may notice disk full errors. These may surface in different...]]></description>
      <content:encoded><![CDATA[While working on Azure App service, you may notice disk full errors. These may surface in different ways for e.g.
<ol>
 	<li>The application may get the error "System.IO.IOException: There is not enough space on the disk".</li>
 	<li>You may see disk errors while browsing to the KUDU Console.</li>
 	<li>You try to publish using VSTS or Visual Studio and you get an error like "ERROR_NOT_ENOUGH_DISK_SPACE: Web deployment task failed. (Web Deploy detected insufficient space on disk)".</li>
</ol>
In this post, I will cover how you can identify why you are getting these errors, and identify what inside your Web App might be consuming disk space.

First and foremost, it is important to understand that each App Service Plan gets an allocation of disk space corresponding to the pricing tier.

At the time of writing of this blog, this is the amount of disk space that is available per pricing tier ( This might change in future so you should check out <a href="https://azure.microsoft.com/en-in/pricing/details/app-service/plans/">https://azure.microsoft.com/en-in/pricing/details/app-service/plans/</a> which should have the updated information.)

&nbsp;
<table width="890" border="1" cellspacing="0" cellpadding="0">
<thead>
<tr>
<td width="248"></td>
<td width="184"><strong>FREE</strong></td>
<td width="184"><strong>SHARED</strong></td>
<td width="184"><strong>BASIC</strong></td>
<td width="184"><strong>STANDARD</strong></td>
<td width="184"><strong>PREMIUM</strong></td>
</tr>
</thead>
<tbody>
<tr>
<td width="248">Disk space</td>
<td width="184">1 GB</td>
<td width="184">1 GB</td>
<td width="184">10 GB</td>
<td width="184">50 GB</td>
<td width="184">250 GB</td>
</tr>
</tbody>
</table>
&nbsp;

All of your Web Apps in the same App Service Plan will share the disk space. If your files on the disk exceed this limit, you will start getting disk full kind of errors.

Your files will include one or more of the items in the following list.
<ul>
 	<li>The Web Site Content</li>
 	<li>The App_Data for an Asp.Net Application</li>
 	<li>The Logfiles folder.</li>
</ul>
The reason why it becomes a little tricky to figure out this issue is because you have may have multiple Web Apps in an App Service Plan. If one of the Web Apps is taking more disk space than the others, you may not be able to easily identify which Web App to investigate.

However, to help you, the <strong>Quotas</strong> blade at the Web App level in Azure portal (<a href="https://portal.azure.com/">https://portal.azure.com/</a>) allows you identify this issue easily. Here is a screenshot of what I see when search for Quotas in the settings for my Web App.

&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/QuotasApp1.png"><img width="1238" height="594" class="alignnone size-full wp-image-215" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/06/QuotasApp1.png" /></a>

&nbsp;

In the above screenshot, you can see two quotas.
<ol>
 	<li>The<span> </span><strong>File System Usage (App)</strong><span> </span>which is the disk space consumed by my Web App.</li>
 	<li><span> The </span><strong>File System Usage (App Service Plan)</strong><span> </span>which is the disk space consumed by the<span> </span><strong>App Service plan.</strong><span> </span></li>
</ol>
<span> </span>The above image illustrates that the App Service plan is consuming<span> </span><strong>6.13GB</strong><span> </span>of disk space (out of<span> </span><strong>50 GB</strong><span> </span>total as my Web App is on a Standard Plan which gives me 50 GB) and my Web App is consuming<span> </span><strong>4.68 GB</strong><span> </span>out of this<span> </span><strong>6.13 GB</strong><span>.</span>

The remaining disk space is consumed by the other Web Apps in the App Service Plan.

So from here, I can quickly identify whether my current Web App (i.e. the Web App currently selected in the portal) ,is consuming high disk space or if the disk space is consumed by another Web App in the same App Service Plan. If the current Web App is consuming the disk space then I have already identified the culprit, otherwise I will look at the other Web Apps in my App Service Plan and check the Quotas blade for those Web Apps individually.

To list all of  the Web Apps in the App Service plan , I can click on<span> </span><strong>App Service Plan</strong><span> </span>for my Web App and click on the <span> </span><strong>Apps</strong><span> </span>setting.  This will show me all the sites under my App Service Plan and from there on , I can click on each Web App and look at the Quotas blade for that Web App to see how much disk space that Web App is consuming.

This maybe complex if there are many Web Apps under the same App Service Plan. Please note that this part of the portal is subject to change and please feedback on <a href="http://feedback.azure.com">http://feedback.azure.com</a> if you have any input.

In the meantime, I wrote a small <strong><a href="https://blogs.msdn.microsoft.com/puneetgupta/2016/03/21/automating-webapps-hosted-in-azure-app-service-through-powershell-arm-way/#FindDiskUsageAppServicePlan">PowerShell script</a> that can help you find this information</strong>. Just pass the Web App name and the subscription ID and the script will identify the App Service Plan for the Web App and show App Service Plan disk usage and a breakup of disk space consumed by all Web App and slots in your App Service Plan.

<strong>Once you identify the right Web App,</strong><span> </span>you may want to understand<span> </span><strong>what content inside that Web App</strong><span> </span>is consuming high disk space. For that, you can install the Disk Usage Site extension on that Web App to identify what exactly within that Web App is consuming the maximum space. There is a good external blog that talks about how to use this extension<span> </span><a href="http://fenglu.me/2017/02/18/Review-and-manage-your-web-site-space-in-Azure/">http://fenglu.me/2017/02/18/Review-and-manage-your-web-site-space-in-Azure/</a> so I am not going to repeat the steps but using this extension you can exactly identify which sites or folders within your WebApp content are consuming high disk space.

Hope this information helps !!!]]></content:encoded>
    </item>
    <item>
      <title>Automating WebApps hosted in Azure App Service through PowerShell - ARM Way</title>
      <link>https://docs.microsoft.com/archive/blogs/puneetgupta/automating-webapps-hosted-in-azure-app-service-through-powershell-arm-way</link>
      <pubDate>Mon, 21 Mar 2016 13:27:01 GMT</pubDate>
      <dc:creator><![CDATA[PuneetG]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/puneetgupta/?p=101</guid>
      <description><![CDATA[Azure Resource Manager is a powerful way of automating almost anything in Azure. In this blog I will...]]></description>
      <content:encoded><![CDATA[<strong>Azure Resource Manager</strong> is a powerful way of automating almost anything in Azure. In this blog I will talk about how we use the ARM based PowerShell CmdLets to automate common tasks for managing / maintaining WebApps in Azure App Service.

First of all, I want to mention that there are two modes for writing PowerShell scripts to automate Azure. When you install Azure PowerShell two sets of modules get installed namely Azure Service Management (ASM) and Azure Resource Management(ARM). Both of these had different powershell commands to achieve the same result. In this blog post, I will talk about the ARM way of automating Azure Resources because ARM is the preferred way going forward and ARM is what the latest Azure portal (<a href="https://portal.azure.com/"><span style="color: #0563c1">https://portal.azure.com</span></a>) uses and is more promising from a feature set.

<strong>Installing Azure PowerShell</strong>

The easiest way to install Azure PowerShell is through <strong>Web Platform Installer</strong> (WEB PI). If you do not have Web Platform Installer, install it first from <a href="https://www.microsoft.com/web/downloads/platform.aspx"><span style="color: #0563c1">https://www.microsoft.com/web/downloads/platform.aspx</span></a>. Once Web Platform installer is installed, launch it by going to Start and typing Web Platform Installer. Once WEB PI launches, search for Azure PowerShell and choose Microsoft PowerShell from the list below and click Add and then Install to install Azure PowerShell

<a href="https://msdnshared.blob.core.windows.net/media/2016/03/WebPi.jpg"><img class="alignnone wp-image-112 size-full" src="https://msdnshared.blob.core.windows.net/media/2016/03/WebPi.jpg" alt="WebPi" width="890" height="424" /></a>

The download for Azure PowerShell is roughly 30 MB so shouldn’t take long to install. Once installed, you can just type Windows PowerShell in the Start Menu and the PowerShell Command window will open which will allow you to run the Azure PowerShell Commands. I prefer using the <strong>Windows PowerShell ISE</strong> to write my PowerShell scripts just because it provides you intellisense, color coding and lets you easily view details of the CmdLets that are available in PowerShell modules so if you choose <strong>AzureRM.Websites</strong> in the Modules dropdown, you can see the list of available cmdlets for WebApps like this.

<a href="https://msdnshared.blob.core.windows.net/media/2016/03/PowerShellIse.png"><img class="alignnone wp-image-121 size-full" src="https://msdnshared.blob.core.windows.net/media/2016/03/PowerShellIse.png" alt="PowerShellIse" width="505" height="772" /></a>

All these commands are documented in detailed in MSDN @ <a href="https://msdn.microsoft.com/en-us/library/mt619237.aspx">https://msdn.microsoft.com/en-us/library/mt619237.aspx</a> and I won’t spend too much time talking about each command as the names are self-explanatory.

One last thing that I want to talk about before diving in the code is <span style="text-decoration: underline"><strong>Azure Resource Manager Explorer</strong> </span>which is basically an online tool that gives you a tree-view of all your resources in Azure. If you are often involved in writing PowerShell scripts for Azure then knowing about this tool is a must. You can watch a small video @ <a href="https://azure.microsoft.com/en-us/documentation/videos/azure-resource-manager-explorer-with-david-ebbo/">https://azure.microsoft.com/en-us/documentation/videos/azure-resource-manager-explorer-with-david-ebbo/</a> to get a quick understanding of how this works and this tool is what I have used in most of the scripts that I created. What is even more cool is that the <strong>ARM Explorer</strong> is open source and available at <a href="https://github.com/projectkudu/ARMExplorer">https://github.com/projectkudu/ARMExplorer</a>. To access <strong>Azure Resource Manager Explorer</strong>, you browse to <a href="https://resources.azure.com/">https://resources.azure.com</a> and sign in with the same credentials that you use to sign-in to the Azure Portal and the ARM Explorer shows you all your resources in a tree view. You can search for a resource name and see more details of a particular resource. So in the below screenshot, I searched for one my existing sites called demowebcamp and I see the following

<a href="https://msdnshared.blob.core.windows.net/media/2016/03/ARMView.png"><img class="alignnone wp-image-131 size-large" src="https://msdnshared.blob.core.windows.net/media/2016/03/ARMView-e1458639825477-1024x623.png" alt="ARMView" width="1024" height="623" /></a>

So here you can see all he configurations for your WebApp. What is even cool is if you click on the last tab (PowerShell), it shows you same powershell commands that you can use to create \ modify \ delete your resource like this

<a href="https://msdnshared.blob.core.windows.net/media/2016/03/PoweShellView.png"><img class="alignnone wp-image-132 size-large" src="https://msdnshared.blob.core.windows.net/media/2016/03/PoweShellView-1024x491.png" alt="PoweShellView" width="1024" height="491" /></a>

Notice that in the above window, we are not even using any <strong>AzureRM.Websites</strong> Cmdlet (like <strong>Get-AzureRMWebApp</strong> or <strong>Set-AzureRMWebApp</strong>) and the tool is showing the generic <strong>Azure Resource Manager</strong> Cmdlets (like <strong>Get-AzureRMResource</strong>, <strong>Set-AzureRMResource</strong>, <strong>Remove-AzureRMResource</strong>) with the right set of parameters applied for WebApp so configuring something in a WebApp now is as easy as finding out where the setting lies in the resource tree shown by <a href="https://resources.azure.com/">https://resources.azure.com</a> and then clicking the PowerShell tab to understand how to write the script for changing that particular setting.

So whenever we want to write some powershell script which has to modify or configure something, just follow this approach
<ol>
 	<li>Open <a href="https://resources.azure.com">https://resources.azure.com</a> and find the resource that you want to configure (For e.g. WebApp or App Service Plan)</li>
 	<li>Expand the tree nodes beneath the resource to identify the setting that you want to configure</li>
 	<li>Switch to the PowerShell tab in the tool to identify the right set of PowerShell command corresponding to that operation.</li>
</ol>
With that, let’s see the code for some of the common tasks that you might want to perform on WebApp
<ol>
 	<li><a href="https://blogs.msdn.microsoft.com/puneetgupta/wp-admin/post.php?post=101&amp;action=edit#StartStopRestartWebApp">Stopping / Starting / Restarting WebApp</a></li>
 	<li><a href="#CreatingANewWebAppInNewResourceGroup">Creating A New WebApp in a New Resource Group</a></li>
 	<li><a href="#DownloadPublishProfileForWebApp">Downloading Publish Profile For a WebApp</a></li>
 	<li><a href="#ConfiguringAlwaysOnforWebApp">Configuring Always-On for WebApp</a></li>
 	<li><a href="AddingVirtualDirectoryMarkedAsApplication">Adding a Virtual Directory Marked as an Application to the site</a></li>
 	<li><a href="#ScaleWebAppPricingTier">Scaling the WebApp from one pricing Tier to another</a></li>
 	<li><a href="#ConfigureConnectionStringForWebApp">Configure Connection String for a WebApp</a></li>
 	<li><a href="#AppendAppSettingToExistingCollection">Append New AppSetting to the existing list of App Settings for a WebApp</a></li>
 	<li><a href="#AddHostNameForWebApp">Adding a HOSTNAME for a WebApp</a></li>
 	<li><a href="#AddSSLBindingForWebApp">Adding a SSL Binding for a WebApp</a></li>
 	<li><a href="#CreateNewSlotForWebApp">Adding a NEW Slot to a WebApp</a></li>
 	<li><a href="#AddStickySlotSettingForWebApp">Adding a Sticky To Slot Setting for a WebApp</a></li>
 	<li><a href="#SwapAzureWebAppWithSlot">Performing Swap operation on a WebApp</a></li>
 	<li><a href="#DeleteWebApp">Delete a WebApp</a></li>
 	<li><a href="#ModifyCorsSettingsForWebApp">Modify CORS setting on the WebApp</a></li>
 	<li><a href="#ListSitesInAppHostingPlan">List Sites in App Service Plan</a></li>
 	<li><a href="#FindDiskUsageAppServicePlan">List Disk Usage of all Sites in App Service Plan</a></li>
</ol>
<strong><span style="text-decoration: underline">Most of the snippets below use the following function which is required to get the resource group name for a WebApp so this should be included in the script snippet</span></strong>

<script src="https://gist-it.appspot.com/https://github.com/puneet-gupta/AzureAppServicePowershellSamples/blob/master/Functions.ps1?footer=minimal"></script><b><span style="text-decoration: underline">Stopping / Starting / Restarting WebApp</span></b><script src="https://gist-it.appspot.com/https://github.com/puneet-gupta/AzureAppServicePowershellSamples/blob/master/StartStopRestartWebApp.ps1?footer=minimal"></script>

<b><span id="CreatingANewWebAppInNewResourceGroup" style="text-decoration: underline">Creating A New WebApp in a New Resource Group</span></b>

<script src="https://gist-it.appspot.com/https://github.com/puneet-gupta/AzureAppServicePowershellSamples/blob/master/CreateNewWebAppAndNewResourceGroup.ps1?footer=minimal"></script><b><span id="DownloadPublishProfileForWebApp" style="text-decoration: underline">Downloading Publish Profile For a WebApp</span></b><script src="https://gist-it.appspot.com/https://github.com/puneet-gupta/AzureAppServicePowershellSamples/blob/master/DownloadPublishProfileForWebApp.ps1?footer=minimal"></script>

<b><span style="text-decoration: underline">Stopping / Starting / Restarting WebApp</span></b><script src="https://gist-it.appspot.com/https://github.com/puneet-gupta/AzureAppServicePowershellSamples/blob/master/StartStopRestartWebApp.ps1?footer=minimal"></script><b><span id="ConfiguringAlwaysOnforWebApp" style="text-decoration: underline">Configuring Always-On for WebApp</span></b><script src="https://gist-it.appspot.com/https://github.com/puneet-gupta/AzureAppServicePowershellSamples/blob/master/ConfigureAlwaysOnForWebApp.ps1?footer=minimal"></script><b><span id="AddingVirtualDirectoryMarkedAsApplication" style="text-decoration: underline">Adding a Virtual Directory Marked as an Application to the site</span></b><script src="https://gist-it.appspot.com/https://github.com/puneet-gupta/AzureAppServicePowershellSamples/blob/master/AddVdirMarkedAsApplication.ps1?footer=minimal"></script><b><span id="ScaleWebAppPricingTier" style="text-decoration: underline">Scaling the WebApp from one pricing Tier to another</span></b><script src="https://gist-it.appspot.com/https://github.com/puneet-gupta/AzureAppServicePowershellSamples/blob/master/ScaleWebAppPricingTier.ps1?footer=minimal"></script><b><span id="ConfigureConnectionStringForWebApp" style="text-decoration: underline">Configure Connection String for a WebApp</span></b><script src="https://gist-it.appspot.com/https://github.com/puneet-gupta/AzureAppServicePowershellSamples/blob/master/ConfigureConnectionStringForWebApp.ps1?footer=minimal"></script><b><span id="AppendAppSettingToExistingCollection" style="text-decoration: underline">Append New AppSetting to the existing list of App Settings for a WebApp</span></b><script src="https://gist-it.appspot.com/https://github.com/puneet-gupta/AzureAppServicePowershellSamples/blob/master/AppendAppSettingToExistingCollection.ps1?footer=minimal"></script><strong><span style="text-decoration: underline">Adding a HOSTNAME for a WebApp</span></strong><script src="https://gist-it.appspot.com/https://github.com/puneet-gupta/AzureAppServicePowershellSamples/blob/master/AddHostNameForWebApp.ps1?footer=minimal"></script><strong><span id="AddSSLBindingForWebApp" style="text-decoration: underline">Adding a SSL Binding for a WebApp</span></strong><script src="https://gist-it.appspot.com/https://github.com/puneet-gupta/AzureAppServicePowershellSamples/blob/master/AddSSLBindingForWebApp.ps1?footer=minimal"></script><span id="CreateNewSlotForWebApp" style="text-decoration: underline"><strong>Adding a NEW Slot to a WebApp</strong></span><script src="https://gist-it.appspot.com/https://github.com/puneet-gupta/AzureAppServicePowershellSamples/blob/master/CreateNewSlotForWebApp.ps1?footer=minimal"></script><span id="AddStickySlotSettingForWebApp" style="text-decoration: underline"><strong>Adding a Sticky To Slot Setting for a WebApp</strong></span><script src="https://gist-it.appspot.com/https://github.com/puneet-gupta/AzureAppServicePowershellSamples/blob/master/AddStickySlotSettingForWebApp.ps1?footer=minimal"></script>

<span id="SwapAzureWebAppWithSlot" style="text-decoration: underline"><strong>Performing Swap Operation on a WebApp</strong></span><script src="https://gist-it.appspot.com/https://github.com/puneet-gupta/AzureAppServicePowershellSamples/blob/master/SwapAzureWebAppWithSlot.ps1?footer=minimal"></script><span id="DeleteWebApp" style="text-decoration: underline"><strong>Delete a WebApp</strong></span><script src="https://gist-it.appspot.com/https://github.com/puneet-gupta/AzureAppServicePowershellSamples/blob/master/DeleteWebApp.ps1?footer=minimal"></script>

<span id="ModifyCorsSettingsForWebApp" style="text-decoration: underline"><strong>Modify CORS Settings For WebApp</strong></span><script src="https://gist-it.appspot.com/https://github.com/puneet-gupta/AzureAppServicePowershellSamples/blob/master/ModifyCorsSettingsForWebApp.ps1?footer=minimal"></script><span id="ListSitesInAppHostingPlan" style="text-decoration: underline"><strong>List sites in App Service Plan</strong></span><script src="https://gist-it.appspot.com/https://github.com/puneet-gupta/AzureAppServicePowershellSamples/blob/master/ListSitesInAppHostingPlan.ps1?footer=minimal"></script>

<span id="FindDiskUsageAppServicePlan" style="text-decoration: underline"><strong>Find Disk Usage for All sites in App Service Plan</strong></span><script src="https://gist-it.appspot.com/https://github.com/puneet-gupta/AzureAppServicePowershellSamples/blob/master/FindDiskUsageAppServicePlan.ps1?footer=minimal"></script>

If there is some common operation that you need to automate, then kindly mention it in the comments and I will try to update the blog with the code for that.

Hope this helps !!!]]></content:encoded>
    </item>
    <item>
      <title>Azure Website SiteExtension to view EventLogs</title>
      <link>https://docs.microsoft.com/archive/blogs/puneetgupta/azure-website-siteextension-to-view-eventlogs</link>
      <pubDate>Wed, 24 Sep 2014 08:58:07 GMT</pubDate>
      <dc:creator><![CDATA[PuneetG]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/puneetgupta/?p=133</guid>
      <description><![CDATA[Did you know that Microsoft Azure websites have an amazing feature called Site Extensions ? Site...]]></description>
      <content:encoded><![CDATA[Did you know that Microsoft Azure websites have an amazing feature called <strong>Site Extensions ? </strong>Site extensions enables you to write a set to tools that can be installed on any Azure website once your extension is deployed in the SiteExtensions Gallery. To know more about Azure site extensions and Azure <strong>SiteExtensions</strong> gallery, please read <a title="http://azure.microsoft.com/blog/2014/06/20/azure-web-sites-extensions/" href="http://azure.microsoft.com/blog/2014/06/20/azure-web-sites-extensions/">http://azure.microsoft.com/blog/2014/06/20/azure-web-sites-extensions/</a>

Site Extensions can be managed from the Kudu Console (more info <a href="http://blogs.msdn.com/b/benjaminperkins/archive/2014/03/24/using-kudu-with-windows-azure-web-sites.aspx">here</a> ) or the new Azure Portal at <a href="http://portal.azure.com/">http://portal.azure.com</a> . In the new portal you’ll find the settings under Web Sites when you click on your Web Site. When this blade has loaded you’ll find the <b>Extensions </b>section under <b>Configuration Settings.
</b>If you’re not familiar with the new portal yet then this Azure Friday <a href="https://channel9.msdn.com/Shows/Azure-Friday/Overview-of-the-new-Azure-Portal-with-Vishal-Joshi">session</a> is a great view.

Every Azure web site has an <strong>EventLog.xml</strong> which is stored in <strong>D:\home\Logfiles</strong> folder. This eventlog.xml is a dump of Application Event logs and can be really useful in identifying runtime errors that occur on your web site as mentioned <a href="http://blogs.msdn.com/b/waws/archive/2014/05/22/azure-web-sites-troubleshooting-server-error-in-application-errors.aspx">here</a>. If you notice the event log is an XML format and can become hard to read if you have too many events logged. Also it contains events dumped in “raw” format, something like below and is not easily readable.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/62/25/metablogapi/3250.image_70930659.png"><img title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/62/25/metablogapi/6663.image_thumb_642773E1.png" alt="image" width="489" height="372" border="0" /></a>

This site extension will provide you with a formatted view of the Event Log which should be more easily consumed (and slightly prettier as well). Here is a screenshot of the same event when viewed in the site extension.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/62/25/metablogapi/7120.image_15493F33.png"><img title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/62/25/metablogapi/4466.image_thumb_5B5C8CF7.png" alt="image" width="720" height="421" border="0" /></a>

Hope you find this useful. <img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/1.gif" alt="Happy" />

A big thanks to <strong><a href="http://thenextdoorgeek.com/">Rakki Muthukumar</a></strong> for helping with the styling of this page.

<strong><span style="text-decoration: underline">To install this Site extension on your Azure Website</span></strong>
<ol>
<ol>
	<li>Access the KUDU console for you web site by accessing <a href="https://*****.scm.azurewebsites.net/">https://*****.scm.azurewebsites.net</a> where ***** is the name of your Azure Web site (****.azurewebsite.net)</li>
	<li>Click on the Site Extensions tab</li>
	<li>Then click on Gallery and Choose <strong>Azure Web Sites Event Viewer</strong></li>
</ol>
</ol>
<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/62/25/metablogapi/4314.image_695D5B75.png"><img title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/62/25/metablogapi/6404.image_thumb_74897670.png" alt="image" width="240" height="182" border="0" /></a>
<ul>
	<li>Once it is installed, the web page will give you a message saying that the site needs to be restarted and will give you a <strong>Restart Site</strong> button right there.</li>
	<li>Click on the <strong>Restart s</strong>ite button and navigate to the <strong>Installed</strong> section</li>
	<li>Hit the PLAY button to launch the Event Viewer.</li>
	<li>Once this site extension is installed, you can directly launch it by going to <a href="https://*****.scm.azurewebsites.net/EventViewer">https://*****.scm.azurewebsites.net/EventViewer</a></li>
</ul>
&nbsp;

I would appreciate any feedback in this regard !!!]]></content:encoded>
    </item>
    <item>
      <title>How to get the WS-AT Transactions Tab in DCOMCNFG ?</title>
      <link>https://docs.microsoft.com/archive/blogs/puneetgupta/how-to-get-the-ws-at-transactions-tab-in-dcomcnfg</link>
      <pubDate>Fri, 05 Oct 2012 09:01:15 GMT</pubDate>
      <dc:creator><![CDATA[PuneetG]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/puneetgupta/?p=153</guid>
      <description><![CDATA[If you worked with Distributed Transactions, you may already be aware that they are configured in...]]></description>
      <content:encoded><![CDATA[If you worked with Distributed Transactions, you may already be aware that they are configured in “Component services” MMC. We can also configure WS-AT transactions in “Component Services”, but there are a few steps required to configure it properly. In this blog I will talk about how to enable this functionality in the MMC and the various issues that you can run into while configuring it.

By default on a new installation of any Operating System, the WS-AT TAB is not present in the Component Services MMC under the MSDTC settings and this is how the default UI looks like.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/12/67/metablogapi/6765.clip_image001_087970C9.png"><img title="clip_image001" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/12/67/metablogapi/8400.clip_image001_thumb_6DCCD4AF.png" alt="clip_image001" width="267" height="295" border="0" /></a>

<strong>WsatUI.dll</strong> is the managed UI Extension DLL that contains this TAB functionality and it needs to be registered using the <strong>regasm </strong>tool.

<strong><span style="text-decoration: underline">So where to get WSATUI.DLL from?</span></strong>

This DLL ships as a part of the Windows SDK for .NET Framework and if the machine has.NET Framework 4.0, you need to install the <strong>Windows 7 SDK for .NET Framework 4.0 </strong>from <a href="http://www.microsoft.com/en-us/download/dlx/listdetailsview.aspx?id=8279">http://www.microsoft.com/en-us/download/dlx/listdetailsview.aspx?id=8279</a> and if the machine has the .NET Framework 3.0 or .NET Framework 3.5 installed, then you can install the <strong>Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1</strong> from <a href="http://www.microsoft.com/en-us/download/details.aspx?id=3138">http://www.microsoft.com/en-us/download/details.aspx?id=3138</a>. It is a huge download and it can take some time to download and install. Also don’t get confused by the name of the SDK – the name says <strong>Windows 7 SDK for .net framework 4.0</strong> but this can be installed on Windows Server 2003 or Windows Server 2008 also. To make it a bit more clear, the <strong>Windows 7 SDK for .net framework 4.0 </strong>is a Software development Kit for creating apps that run on Windows 7 and .Net Framework and can be installed on prior operating systems too.

Another important thing to note is that you shouldn’t worry about the CPU architecture or the version of .NET Framework that you are using in <strong>your application</strong> because this DLL is used by Component Services MMC only and your application will never be using this DLL directly. So even if your application uses .NET Framework 3.0 or 3.5 on a machine that has .NET 4.0 installed, you should still install the <strong>Windows 7 SDK for .NET Framework 4.0</strong>

<strong><span style="text-decoration: underline">Registering the WSATUI.DLL</span></strong>

After the installation open the SDK <strong>Command shell</strong> from the <strong>Start</strong> -&gt; <strong>Programs -&gt; Microsoft Windows SDK &lt;version_number&gt;</strong> menu (on VISTA and above operating systems, right click on the <strong>Command shell</strong> and choose “Run As Administrator” and run the right REGASM command (assuming you installed the SDK in the default locations)

<strong><span style="text-decoration: underline">Table 1</span></strong>
<table style="border: currentColor;border-collapse: collapse">
<tbody>
<tr>
<td style="padding: 0in 5.4pt;border: 1pt solid windowtext" width="134">
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt">Operating System Processor Architecture</span></p>
&nbsp;</td>
<td style="border-width: 1pt 1pt 1pt medium;border-style: solid solid solid none;border-color: windowtext windowtext windowtext currentColor;padding: 0in 5.4pt" width="120">
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt">Highest Version of Framework installed on the computer</span></p>
&nbsp;</td>
<td style="border-width: 1pt 1pt 1pt medium;border-style: solid solid solid none;border-color: windowtext windowtext windowtext currentColor;padding: 0in 5.4pt" width="112">
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt">Installed SDK Version</span></p>
&nbsp;</td>
<td style="border-width: 1pt 1pt 1pt medium;border-style: solid solid solid none;border-color: windowtext windowtext windowtext currentColor;padding: 0in 5.4pt" width="270">
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt">Command to Run</span></p>
&nbsp;</td>
</tr>
<tr>
<td style="border-width: medium 1pt 1pt;border-style: none solid solid;border-color: currentColor windowtext windowtext;padding: 0in 5.4pt" rowspan="4" width="134">
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt">32 Bit</span></p>
&nbsp;
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt"> </span></p>
&nbsp;</td>
<td style="border-width: medium 1pt 1pt medium;border-style: none solid solid none;border-color: currentColor windowtext windowtext currentColor;padding: 0in 5.4pt" rowspan="3" width="120">
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt">3.0 , 3.5</span></p>
&nbsp;
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt"> </span></p>
&nbsp;</td>
<td style="border-width: medium 1pt 1pt medium;border-style: none solid solid none;border-color: currentColor windowtext windowtext currentColor;padding: 0in 5.4pt" width="112">
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt">V6.0</span></p>
&nbsp;</td>
<td style="border-width: medium 1pt 1pt medium;border-style: none solid solid none;border-color: currentColor windowtext windowtext currentColor;padding: 0in 5.4pt" width="270">
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt">Regasm /codebase “</span><strong><span style="font-size: 11pt">c:\Program Files\Microsoft SDKs\Windows\v6.0\Bin\WsatUI.dll”</span></strong></p>
&nbsp;</td>
</tr>
<tr>
<td style="border-width: medium 1pt 1pt medium;border-style: none solid solid none;border-color: currentColor windowtext windowtext currentColor;padding: 0in 5.4pt" width="112">
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt">V6.1</span></p>
&nbsp;</td>
<td style="border-width: medium 1pt 1pt medium;border-style: none solid solid none;border-color: currentColor windowtext windowtext currentColor;padding: 0in 5.4pt" width="270">
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt">Regasm /codebase “</span><strong><span style="font-size: 11pt">c:\Program Files\Microsoft SDKs\Windows\v6.1\Bin\WsatUI.dll”</span></strong></p>
&nbsp;</td>
</tr>
<tr>
<td style="border-width: medium 1pt 1pt medium;border-style: none solid solid none;border-color: currentColor windowtext windowtext currentColor;padding: 0in 5.4pt" width="112">
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt">v7.0</span></p>
&nbsp;</td>
<td style="border-width: medium 1pt 1pt medium;border-style: none solid solid none;border-color: currentColor windowtext windowtext currentColor;padding: 0in 5.4pt" width="270">
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt">Regasm /codebase “</span><strong><span style="font-size: 11pt">c:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\WsatUI.dll”</span></strong></p>
&nbsp;</td>
</tr>
<tr>
<td style="border-width: medium 1pt 1pt medium;border-style: none solid solid none;border-color: currentColor windowtext windowtext currentColor;padding: 0in 5.4pt" width="120">
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt">4.0 </span></p>
&nbsp;
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt"> </span></p>
&nbsp;
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt">(see note below)</span></p>
&nbsp;</td>
<td style="border-width: medium 1pt 1pt medium;border-style: none solid solid none;border-color: currentColor windowtext windowtext currentColor;padding: 0in 5.4pt" width="112">
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt">v7.1</span></p>
&nbsp;</td>
<td style="border-width: medium 1pt 1pt medium;border-style: none solid solid none;border-color: currentColor windowtext windowtext currentColor;padding: 0in 5.4pt" width="270">
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt">Regasm /codebase “</span><strong><span style="font-size: 11pt">c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\WsatUI.dll”</span></strong></p>
&nbsp;</td>
</tr>
<tr>
<td style="border-width: medium 1pt 1pt;border-style: none solid solid;border-color: currentColor windowtext windowtext;padding: 0in 5.4pt" rowspan="4" width="134">
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt">64 Bit</span></p>
&nbsp;</td>
<td style="border-width: medium 1pt 1pt medium;border-style: none solid solid none;border-color: currentColor windowtext windowtext currentColor;padding: 0in 5.4pt" rowspan="3" width="120">
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt">3.0 or 3.5</span></p>
&nbsp;
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt"> </span></p>
&nbsp;</td>
<td style="border-width: medium 1pt 1pt medium;border-style: none solid solid none;border-color: currentColor windowtext windowtext currentColor;padding: 0in 5.4pt" width="112">
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt">V6.0</span></p>
&nbsp;</td>
<td style="border-width: medium 1pt 1pt medium;border-style: none solid solid none;border-color: currentColor windowtext windowtext currentColor;padding: 0in 5.4pt" width="270">
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt">Regasm /codebase “</span><strong><span style="font-size: 11pt">c:\ Program Files\Microsoft SDKs\Windows\v6.0\Bin\x64\WsatUI.dll”</span></strong></p>
&nbsp;</td>
</tr>
<tr>
<td style="border-width: medium 1pt 1pt medium;border-style: none solid solid none;border-color: currentColor windowtext windowtext currentColor;padding: 0in 5.4pt" width="112">
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt">V6.1</span></p>
&nbsp;</td>
<td style="border-width: medium 1pt 1pt medium;border-style: none solid solid none;border-color: currentColor windowtext windowtext currentColor;padding: 0in 5.4pt" width="270">
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt">Regasm /codebase “</span><strong><span style="font-size: 11pt">c:\ Program Files\Microsoft SDKs\Windows\v6.1\Bin\ x64\WsatUI.dll”</span></strong></p>
&nbsp;</td>
</tr>
<tr>
<td style="border-width: medium 1pt 1pt medium;border-style: none solid solid none;border-color: currentColor windowtext windowtext currentColor;padding: 0in 5.4pt" width="112">
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt">v7.0</span></p>
&nbsp;</td>
<td style="border-width: medium 1pt 1pt medium;border-style: none solid solid none;border-color: currentColor windowtext windowtext currentColor;padding: 0in 5.4pt" width="270">
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt">Regasm /codebase “</span><strong><span style="font-size: 11pt">c:\ Program Files\Microsoft SDKs\Windows\v7.0\Bin\ x64\WsatUI.dll”</span></strong></p>
&nbsp;
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt"> </span></p>
&nbsp;</td>
</tr>
<tr style="height: 67.65pt">
<td style="border-width: medium 1pt 1pt medium;border-style: none solid solid none;border-color: currentColor windowtext windowtext currentColor;padding: 0in 5.4pt" width="120">
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt">4.0 </span></p>
&nbsp;
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt"> </span></p>
&nbsp;
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt">(see Note below)</span></p>
&nbsp;</td>
<td style="border-width: medium 1pt 1pt medium;border-style: none solid solid none;border-color: currentColor windowtext windowtext currentColor;padding: 0in 5.4pt" width="112">
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt">v7.1</span></p>
&nbsp;</td>
<td style="border-width: medium 1pt 1pt medium;border-style: none solid solid none;border-color: currentColor windowtext windowtext currentColor;padding: 0in 5.4pt" width="270">
<p style="margin: 0in 0in 0pt;line-height: normal"><span style="font-size: 11pt">Regasm /codebase “</span><strong><span style="font-size: 11pt">c:\ Program Files\Microsoft SDKs\Windows\v7.1\Bin\ x64\WsatUI.dll”</span></strong></p>
&nbsp;</td>
</tr>
</tbody>
</table>
NOTE: The version of Windows 7 SDK for .NET Framework 4.0 have an issue that while running the <strong>regasm</strong> command you may get an error complaining about the assembly Authenticode signatures and you may get an error like this.

<span style="color: #0000ff">C:\Program Files\Microsoft SDKs\Windows\v7.1&gt;regasm /codebase "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\wsatui.dll" Microsoft (R) .NET Framework Assembly Registration Utility 4.0.30319.1 Copyright (C) Microsoft Corporation 1998-2004.  All rights reserved. RegAsm : error RA0000 : Could not load file or assembly 'WsatUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A) </span>

This happens due to a small issue in the file that is packaged in the SDK. If you run in to this issue, you can do one of the two things to fix this problem
<ul>
	<li>Turn off strong name validation just on the WSATUI.DLL by running the following command from the same SDK CMD shell</li>
</ul>
<span style="color: #0000ff">C:\Program Files\Microsoft SDKs\Windows\v7.1&gt;sn -Vr "c:\Program Files\Microsoft SDKs\Windows\v7.1\bin\wsatui.dll" Microsoft (R) .NET Framework Strong Name Utility  Version 4.0.30319.1 Copyright (c) Microsoft Corporation.  All rights reserved. Verification entry added for assembly 'WsatUI,B03F5F7F11D50A3A' </span>

After this you should be able to run the REGASM command
<ul>
	<li>If you don’t want to turn off the strong name validation on this DLL, then you need to replace the WSATUI.DLL in the folder <strong>c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\</strong> with the DLL from a machine which has got <strong>Visual Studio 2010</strong> installed. On a machine that has Visual Studio 2010 installed, you can get this DLL from the folder <strong>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\WSATUI.dll</strong> and copy it to the destination server. Once that is done you can run the <strong>regasm</strong> command and it should work.</li>
</ul>
If the above steps are followed, the DLL’s should be registered correctly and you should be able to see the WS-AT tab, however if this is not done correctly or if there is some kind of a version mismatch, you may see an error like the below one when you try to go to the WS-AT TAB in the Component Services

The error “The installed version of Windows Communication Foundation does not match the version of the WSAT configuration tool” will come if the version of the WSATUI.DLL registered on the server is <strong><span style="text-decoration: underline">lower</span></strong> than the <strong><span style="text-decoration: underline">highest version of the framework</span></strong> installed on the server. To check the highest version of .net framework installed go to <strong>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP</strong> and look for the highest version. So from the below screenshot, you can see that the machine has .net framework 4.0 installed

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/12/67/metablogapi/5148.clip_image002_69AA28C9.png"><img style="margin: 0px" title="clip_image002" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/12/67/metablogapi/4643.clip_image002_thumb_56F52F12.png" alt="clip_image002" width="244" height="132" border="0" /></a>

The next thing to check is the version of the WSATUI.DLL that is registered on the server and that can be looked inside <strong>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WSAT\3.0. </strong>This key will have a string value called PATH and that will tell us the location of the WSATUI.DLL.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/12/67/metablogapi/4705.image_12EA1F1C.png"><img title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/12/67/metablogapi/4774.image_thumb_38076988.png" alt="image" width="788" height="109" border="0" /></a>

If the location of WSATUI.DLL shows as 6.0,6.1 or 7.0 , WSATUI.dll will only support 3.5 Framework version. If it shows as registered from v7.1 path, it can work with 4.0 framework version.

So if you see that the version of the .NET Framework installed on the machine is higher than the version that WSATUI.DLL supports, then follow the combinations given in the <strong><span style="text-decoration: underline">Table-1</span></strong> (above in this article) and install the right version of SDK and register the WSATUI.DLL from the correct path and that should fix this error.]]></content:encoded>
    </item>
    <item>
      <title>Finding out the Thread which is actually handling the WCF request for the HttpContext</title>
      <link>https://docs.microsoft.com/archive/blogs/puneetgupta/finding-out-the-thread-which-is-actually-handling-the-wcf-request-for-the-httpcontext</link>
      <pubDate>Tue, 11 Jan 2011 09:06:54 GMT</pubDate>
      <dc:creator><![CDATA[PuneetG]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/puneetgupta/?p=154</guid>
      <description><![CDATA[In the recent past, the PSSCOR2 debugger extension was made public. This debugger extension contains...]]></description>
      <content:encoded><![CDATA[<span lang="EN" style="font-family: 'Calibri','sans-serif'">In the recent past, the <a title="PSSCOR2" href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=5c068e9f-ebfe-48a5-8b2f-0ad6ab454ad4&amp;displayLang=en">PSSCOR2 </a>debugger extension was made public. This debugger extension contains a very useful command called <strong><span style="font-family: 'Calibri','sans-serif'">!aspxpages </span></strong>which shows you information about various asp.net requests running in the dump, the time they have been executing and the thread associated with the System.Web.HttpContext. Here is an example of what this command shows you </span>

&nbsp;
<div id="codeSnippetWrapper" style="text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 20px 0px 10px;width: 97.5%;font-family: 'Courier New', courier, monospace;direction: ltr;font-size: 8pt;overflow: auto;cursor: text;border: silver 1px solid;padding: 4px">
<pre id="codeSnippet" style="text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px">0:000&gt; !aspxpages
Going to dump the HttpContexts found in the heap.
Loading the heap objects into our cache.
HttpContext    Timeout  Completed     Running  ThreadId ReturnCode   Verb RequestPath+QueryString
0x01bbf914    11647 Sec       yes                   XXX        200   POST /MySleepingWcfService/Service.svc 
0x01bc0ba4    11647 Sec       yes                   XXX        200   POST /MySleepingWcfService/Service.svc 
0x01bc17c4    11647 Sec       yes                   XXX        200   POST /MySleepingWcfService/Service.svc 
0x01bc4660    11647 Sec       yes                   XXX        200   POST /MySleepingWcfService/Service.svc 
0x01bc56a4    11647 Sec       yes                   XXX        200   POST /MySleepingWcfService/Service.svc 
0x01bc6660    11647 Sec       yes                   XXX        200   POST /MySleepingWcfService/Service.svc 
0x01bc76a4    11647 Sec       yes                   XXX        200   POST /MySleepingWcfService/Service.svc 
0x01bc8660    11647 Sec       yes                   XXX        200   POST /MySleepingWcfService/Service.svc 
0x01bc96a4    11647 Sec       yes                   XXX        200   POST /MySleepingWcfService/Service.svc 
0x01bca6fc    11647 Sec       yes                   XXX        200   POST /MySleepingWcfService/Service.svc 
0x01bcb740    11647 Sec       yes                   XXX        200   POST /MySleepingWcfService/Service.svc 
0x01bcc6fc    11647 Sec       yes                   XXX        200   POST /MySleepingWcfService/Service.svc 
0x01bcd740    11647 Sec       yes                   XXX        200   POST /MySleepingWcfService/Service.svc 
0x01bce6fc    11647 Sec       yes                   XXX        200   POST /MySleepingWcfService/Service.svc 
0x01bcf740    11647 Sec       yes                   XXX        200   POST /MySleepingWcfService/Service.svc 
0x01bd0784    11647 Sec       yes                   XXX        200   POST /MySleepingWcfService/Service.svc 
0x01bd17c8    11647 Sec        no        29 Sec      27        200   POST /MySleepingWcfService/Service.svc 
0x01bd2814    11647 Sec       yes                   XXX        200   POST /MySleepingWcfService/Service.svc 
0x01bd3858    11647 Sec       yes                   XXX        200   POST /MySleepingWcfService/Service.svc 
0x01bd4814    11647 Sec        no        29 Sec      29        200   POST /MySleepingWcfService/Service.svc 
0x01bd68dc    11647 Sec        no        29 Sec      24        200   POST /MySleepingWcfService/Service.svc 
0x01bdb404    11647 Sec        no        29 Sec      31        200   POST /MySleepingWcfService/Service.svc 
0x01be3404    11647 Sec        no        28 Sec      33        200   POST /MySleepingWcfService/Service.svc 
0x01bfd404    11647 Sec        no        28 Sec      35        200   POST /MySleepingWcfService/Service.svc 
0x01c0f41c    11647 Sec        no        27 Sec      37        200   POST /MySleepingWcfService/Service.svc 
0x01c1541c    11647 Sec        no        27 Sec      39        200   POST /MySleepingWcfService/Service.svc 
0x01c3c634    11647 Sec       yes                   XXX        200   POST /MySleepingWcfService/Service.svc 
0x01c404c8    11647 Sec        no        25 Sec      41        200   POST /MySleepingWcfService/Service.svc 
0x01c6264c    11647 Sec        no        25 Sec      44        200   POST /MySleepingWcfService/Service.svc 
Total 29 HttpContext objects
    
</pre>
</div>
<span lang="EN" style="font-family: 'Calibri','sans-serif'">Using this information you can find out the thread which is handling your request and if the request is taking a longer time to execute, you can check the callstack of the thread to see what it is doing and why it is taking a longer time to execute and this is pretty helpful. If you are hosting WCF services inside IIS, the same command will show you the information about the HttpContexts associated with the WCF requests and the thread handing the request <b>but</b> because of the way the WCF requests work inside IIS, the thread reported by the !aspxpages command will always show you the call-stack like below. </span>
<div id="codeSnippetWrapper" style="text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 20px 0px 10px;width: 97.5%;font-family: 'Courier New', courier, monospace;direction: ltr;font-size: 8pt;overflow: auto;cursor: text;border: silver 1px solid;padding: 4px">
<pre id="codeSnippet" style="text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px">0:027&gt; !clrstack
OS Thread Id: 0x2740 (27)
ESP       EIP     
0f4af060 775564f4 [HelperMethodFrame_1OBJ: 0f4af060] System.Threading.WaitHandle.WaitOneNative(Microsoft.Win32.SafeHandles.SafeWaitHandle, UInt32, Boolean, Boolean) 
0f4af10c 6f6e685f System.Threading.WaitHandle.WaitOne(Int64, Boolean) 
0f4af128 6f6e6815 System.Threading.WaitHandle.WaitOne(Int32, Boolean) 
0f4af13c 6f6e67dd System.Threading.WaitHandle.WaitOne() 
0f4af144 79962000 System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(System.Web.HttpApplication, Boolean)
0f4af174 799618f4 System.ServiceModel.Activation.HttpModule.ProcessRequest(System.Object, System.EventArgs)
0f4af19c 6574ec35 System.Web.HttpApplication+SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 
0f4af1b4 65742a5c System.Web.HttpApplication.ExecuteStep(IExecutionStep, Boolean ByRef) 
0f4af1f4 6574e1f3 System.Web.HttpApplication+ApplicationStepManager.ResumeSteps(System.Exception) 
0f4af244 65741fdc System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(System.Web.HttpContext, System.AsyncCallback, System.Object) 
0f4af260 6574554c System.Web.HttpRuntime.ProcessRequestInternal(System.Web.HttpWorkerRequest) 
0f4af294 657451f3 System.Web.HttpRuntime.ProcessRequestNoDemand(System.Web.HttpWorkerRequest) 
0f4af2a4 6574438c System.Web.Hosting.ISAPIRuntime.ProcessRequest(IntPtr, Int32) 
0f4af4b8 70290256 [ContextTransitionFrame: 0f4af4b8]  
0f4af4ec 70290256 [GCFrame: 0f4af4ec]  
0f4af648 70290256 [ComMethodFrame: 0f4af648] 

</pre>
</div>
<span lang="EN" style="font-family: 'Calibri','sans-serif'">The reason for this is the way WCF runtime handles the request. You will always see two threads to process the WCF request. One thread is the CLR ThreadPool thread (which will look something like the above thread) which is the worker thread that comes from ASP.NET and the other thread is an I/O thread that is managed by the WCF IOThreadScheduler (actually created by ThreadPool.UnsafeQueueNativeOverlapped). More details on this behavior are mentioned in <a href="http://blogs.msdn.com/b/wenlong/archive/2008/04/21/wcf-request-throttling-and-server-scalability.aspx">this</a> blog. </span>

<span lang="EN" style="font-family: 'Calibri','sans-serif'">Most of the times you are interested in finding out the actual WCF thread which is servicing this request because that would be the thread which is actually executing the method code inside your WCF service and if your service it service method is taking a long time to execute, that would be thread that would be the thread that requires attention. At this point, there is no direct command to show you the WCF I/O thread. To find that out, you have to look at the managed call-stack of <b>all the threads in a dump file</b> and find out the threads which have a call to </span><span lang="EN" style="font-family: 'Courier New';background: yellow;font-size: 10pt">System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke</span><span lang="EN" style="font-family: 'Calibri','sans-serif'"> function and track that back to the ASP.NET Worker thread to assosiate it with the actual ASP.NET worker thread shown in !aspxpages output. </span>

<span lang="EN" style="font-family: 'Calibri','sans-serif'">So from this dump file, I just picked one such thread which had a call to </span><span lang="EN" style="font-family: 'Courier New';background: yellow;font-size: 10pt">System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke</span><span lang="EN" style="font-family: 'Calibri','sans-serif'"> function (Thread 45). </span>
<div id="codeSnippetWrapper" style="text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 20px 0px 10px;width: 97.5%;font-family: 'Courier New', courier, monospace;direction: ltr;font-size: 8pt;overflow: auto;cursor: text;border: silver 1px solid;padding: 4px">
<pre id="codeSnippet" style="text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px">OS Thread Id: 0x23b4 (45)
ESP       EIP     
0fc8e428 775564f4 [HelperMethodFrame: 0fc8e428] System.Threading.Thread.SleepInternal(Int32) 
0fc8e47c 0f3c00a2 Service.SleepyMethod(Int32)
0fc8e48c 0e6301cd DynamicClass.SyncInvokeSleepyMethod(System.Object, System.Object[], System.Object[])
0fc8e4a0 79957338 <span style="background-color: #ffff00">System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke</span>(System.Object, System.Object[], System.Object[] ByRef)
0fc8e558 79955572 System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(System.ServiceModel.Dispatcher.MessageRpc ByRef)
0fc8e5ac 799550e3 System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(System.ServiceModel.Dispatcher.MessageRpc ByRef)
0fc8e5e4 79955000 System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(System.ServiceModel.Dispatcher.MessageRpc ByRef)
0fc8e610 79954f66 System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(System.ServiceModel.Dispatcher.MessageRpc ByRef)
0fc8e624 79954d43 System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(System.ServiceModel.Dispatcher.MessageRpc ByRef)
0fc8e638 799544c7 System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(System.ServiceModel.Dispatcher.MessageRpc ByRef)
0fc8e658 7995420b System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean)
0fc8e69c 7995415d System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.Dispatch(System.ServiceModel.Dispatcher.MessageRpc ByRef, Boolean)
0fc8e6ac 79953b3e System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(System.ServiceModel.Channels.RequestContext, Boolean, System.ServiceModel.OperationContext)
0fc8e854 79952b4f System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(System.ServiceModel.Channels.RequestContext, System.ServiceModel.OperationContext)
0fc8e888 79952893 System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(System.IAsyncResult)
0fc8e8a0 7991cf05 System.ServiceModel.Dispatcher.ChannelHandler.OnContinueAsyncReceive(System.Object)
0fc8e8b0 79959f86 System.ServiceModel.Channels.IOThreadScheduler+CriticalHelper+WorkItem.Invoke2()
0fc8e8f0 79959f28 System.ServiceModel.Channels.IOThreadScheduler+CriticalHelper+WorkItem.OnSecurityContextCallback(System.Object)
0fc8e8f8 6f6bfe35 System.Security.SecurityContext.Run(System.Security.SecurityContext, System.Threading.ContextCallback, System.Object) 
0fc8e910 79959eed System.ServiceModel.Channels.IOThreadScheduler+CriticalHelper+WorkItem.Invoke()
0fc8e924 79959e70 System.ServiceModel.Channels.IOThreadScheduler+CriticalHelper.ProcessCallbacks()
0fc8e958 79959cca System.ServiceModel.Channels.IOThreadScheduler+CriticalHelper.CompletionCallback(System.Object)
0fc8e984 79959c3f System.ServiceModel.Channels.IOThreadScheduler+CriticalHelper+ScheduledOverlapped.IOCallback(UInt32, UInt32, System.Threading.NativeOverlapped*)
0fc8e990 6193e6dd System.ServiceModel.Diagnostics.Utility+IOCompletionThunk.UnhandledExceptionFrame(UInt32, UInt32, System.Threading.NativeOverlapped*)
0fc8e9c4 6f6bcda4 <span style="background-color: #ffff00">System.Threading._IOCompletionCallback.PerformIOCompletionCallback</span>(UInt32, UInt32, System.Threading.NativeOverlapped*) 
0fc8eb64 70171b6c [GCFrame: 0fc8eb64]  
0fc8ecb8 70171b6c [ContextTransitionFrame: 0fc8ecb8]  


</pre>
</div>
<span lang="EN" style="font-family: 'Calibri','sans-serif'">The rest of the post will walk you through the steps on finding out the HttpContext associated with the above thread. We start by running the command <b>!dso</b> (!dumpstackobjects) on this thread and picking up the object of type </span><b><span style="font-family: 'Calibri','sans-serif'">System.ServiceModel.Channels.IOThreadScheduler+CriticalHelper+WorkItem</span></b><span lang="EN" style="font-family: 'Calibri','sans-serif'">. </span>
<div id="codeSnippetWrapper" style="text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 20px 0px 10px;width: 97.5%;font-family: 'Courier New', courier, monospace;direction: ltr;font-size: 8pt;overflow: auto;cursor: text;border: silver 1px solid;padding: 4px">
<pre id="codeSnippet" style="text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px">0:045&gt; !dso
OS Thread Id: 0x23b4 (45)
ESP/REG  Object   Name
0fc8e480 05f24538 Service
0fc8e48c 05ae2eb8 System.ServiceModel.Dispatcher.SyncMethodInvoker
<b>&lt;stripping for clarity&gt;</b>
0fc8e8f0 05f241d8 System.Security.SecurityContext
0fc8e8fc 05f241c4 System.ServiceModel.Channels.IOThreadScheduler+CriticalHelper+WorkItem
0fc8e900 05f241d8 System.Security.SecurityContext
0fc8e90c 05f241c4 System.ServiceModel.Channels.IOThreadScheduler+CriticalHelper+WorkItem
0fc8e924 01b3a5fc System.Object
<span style="background-color: #ffff00">0fc8e928 05f241c4 System.ServiceModel.Channels.IOThreadScheduler+CriticalHelper+WorkItem</span>
0fc8e958 01b3a5fc System.Object
0fc8e974 01b3a728 System.ServiceModel.Diagnostics.Utility+IOCompletionThunk
0fc8e990 01b3a728 System.ServiceModel.Diagnostics.Utility+IOCompletionThunk
0fc8e9ac 01b3a688 System.Threading.Overlapped
0fc8eb98 01c1ab84 System.Threading.OverlappedData


</pre>
</div>
<span lang="EN" style="font-family: 'Calibri','sans-serif'">Once you find this object, you can dump this out using !do </span>
<div id="codeSnippetWrapper" style="text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 20px 0px 10px;width: 97.5%;font-family: 'Courier New', courier, monospace;direction: ltr;font-size: 8pt;overflow: auto;cursor: text;border: silver 1px solid;padding: 4px">
<pre id="codeSnippet" style="text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px">0:045&gt; !do 05f241c4 
Name: System.ServiceModel.Channels.IOThreadScheduler+CriticalHelper+WorkItem
MethodTable: 79a781a8
EEClass: 796d6aa8
Size: 20(0x14) bytes
GC Generation: 0
(C:\Windows\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll)
Fields:
      MT    Field   Offset                 Type VT     Attr    Value Name
6f73ef38  40019b2        4 ...ding.WaitCallback  0 instance 05af63f0 callback
<span style="background-color: #ffff00">6f7584dc  40019b3        8        System.Object  0 instance 05f15538 state</span>
6f735cf8  40019b4        c ...y.SecurityContext  0 instance 05f241d8 context
6f735204  40019b1      374 ...g.ContextCallback  0   shared   static securityContextCallback
    &gt;&gt; Domain:Value  01235fc0:NotInit  01292638:05aa2278 &lt;&lt;

</pre>
</div>
<span lang="EN" style="font-family: 'Calibri','sans-serif'">From here onwards you have a do a series of !do commands till you reach the HttpContext object. This is how the object hierarchy looks like </span>

<span lang="EN" style="font-family: 'Calibri','sans-serif';color: #c00000">System.ServiceModel.Channels.IOThreadScheduler+CriticalHelper+WorkItem (state) -&gt; SecuritySessionServerSettings+ServerSecuritySessionChannel+ReceiveRequestAsyncResult (innerRequestContext)-&gt; System.ServiceModel.Activation.HostedHttpContext(result) -&gt; System.ServiceModel.Activation.HostedHttpRequestAsyncResult (context) -&gt; System.Web.HttpApplication (_context) -&gt; System.Web.HttpContext </span>

<span lang="EN" style="font-family: 'Calibri','sans-serif'">So picking up the state field from </span><span lang="EN" style="font-family: 'Courier New';font-size: 10pt">IOThreadScheduler+CriticalHelper+WorkItem </span><span lang="EN" style="font-family: 'Calibri','sans-serif'">we get <span style="color: #c00000">SecuritySessionServerSettings+ServerSecuritySessionChannel+ReceiveRequestAsyncResult</span></span>
<div id="codeSnippetWrapper" style="text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 20px 0px 10px;width: 97.5%;font-family: 'Courier New', courier, monospace;direction: ltr;font-size: 8pt;overflow: auto;cursor: text;border: silver 1px solid;padding: 4px">
<pre id="codeSnippet" style="text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px">0:045&gt; !do 05f15538 
Name: System.ServiceModel.Security.SecuritySessionServerSettings+ServerSecuritySessionChannel+ReceiveRequestAsyncResult
MethodTable: 79a2c2d0
EEClass: 7973d4d8
Size: 72(0x48) bytes
GC Generation: 0
(C:\Windows\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll)
Fields:
      MT    Field   Offset                 Type VT     Attr    Value Name
6f73fd5c  40009ae        4 System.AsyncCallback  0 instance 05af63d0 callback
6f7584dc  40009af        8        System.Object  0 instance 05f15428 state
6f75eadc  40009b0       1c       System.Boolean  1 instance        1 completedSynchronously
6f75eadc  40009b1       1d       System.Boolean  1 instance        1 endCalled
6f758a54  40009b2        c     System.Exception  0 instance 00000000 exception
6f75eadc  40009b3       1e       System.Boolean  1 instance        1 isCompleted
6f7424a4  40009b4       10 ....ManualResetEvent  0 instance 00000000 manualResetEvent
6f7584dc  40009b5       14        System.Object  0 instance 05f15580 thisLock
79a77030  40009b6       18 ...viceModelActivity  0 instance 00000000 callbackActivity
79a43d6c  4002dd7       20 ...itySessionChannel  0 instance 05f0e620 channel
<span style="background-color: #ffff00">79a04894  4002dd8       24 ...ls.RequestContext  0 instance 05f08504 innerRequestContext</span>
79a7b610  4002dd9       28 ....Channels.Message  0 instance 05f15868 requestMessage
79a3c6b0  4002dda       2c ...lCorrelationState  0 instance 05f241b0 correlationState
6f75eadc  4002ddb       1f       System.Boolean  1 instance        0 expired
79a7bbcc  4002ddc       30 ...del.TimeoutHelper  1 instance 05f15568 timeoutHelper
6f73ef38  4002dd5      780 ...ding.WaitCallback  0   shared   static onWait
    &gt;&gt; Domain:Value  01235fc0:NotInit  01292638:05e3066c &lt;&lt;
6f73fd5c  4002dd6      784 System.AsyncCallback  0   shared   static onReceive
    &gt;&gt; Domain:Value  01235fc0:NotInit  01292638:05e306bc &lt;&lt;

0:045&gt; !do 05f08504 
Name: System.ServiceModel.Activation.HostedHttpContext
MethodTable: 79a09b98
EEClass: 79696fcc
Size: 68(0x44) bytes
GC Generation: 0
(C:\Windows\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll)
Fields:
      MT    Field   Offset                 Type VT     Attr    Value Name
6f739e70  4000ab9       18      System.TimeSpan  1 instance 05f0851c defaultSendTimeout
6f739e70  4000aba       20      System.TimeSpan  1 instance 05f08524 defaultCloseTimeout
79a432d4  4000abb       10         System.Int32  1 instance        2 state
79a7b610  4000abc        4 ....Channels.Message  0 instance 05f0bbbc requestMessage
6f758a54  4000abd        8     System.Exception  0 instance 00000000 requestMessageException
6f75eadc  4000abe       14       System.Boolean  1 instance        0 replySent
6f75eadc  4000abf       15       System.Boolean  1 instance        0 replyInitiated
6f75eadc  4000ac0       16       System.Boolean  1 instance        0 aborted
6f7584dc  4000ac1        c        System.Object  0 instance 05f08548 thisLock
79a02b04  4000e15       28 ...annels.HttpOutput  0 instance 00000000 httpOutput
79a029ac  4000e16       2c ...hannels.HttpInput  0 instance 05f08554 httpInput
79a03eb0  4000e17       30 ...tpChannelListener  0 instance 05adeaf4 listener
79a8a134  4000e18       34 ...tyMessageProperty  0 instance 00000000 securityProperty
79a09d4c  4000e3a       38 ...dRequestContainer  0 instance 05f0d630 requestContainer
<span style="background-color: #ffff00">79a095b0  4000e3b       3c ...equestAsyncResult  0 instance 01c40c5c result</span>

0:045&gt; !do 01c40c5c 
Name: System.ServiceModel.Activation.HostedHttpRequestAsyncResult
MethodTable: 79a095b0
EEClass: 79696ae8
Size: 60(0x3c) bytes
GC Generation: 0
(C:\Windows\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll)
Fields:
      MT    Field   Offset                 Type VT     Attr    Value Name
6f73fd5c  40009ae        4 System.AsyncCallback  0 instance 01b3a534 callback
6f7584dc  40009af        8        System.Object  0 instance 01c3fba4 state
6f75eadc  40009b0       1c       System.Boolean  1 instance        0 completedSynchronously
6f75eadc  40009b1       1d       System.Boolean  1 instance        0 endCalled
6f758a54  40009b2        c     System.Exception  0 instance 00000000 exception
6f75eadc  40009b3       1e       System.Boolean  1 instance        0 isCompleted
6f7424a4  40009b4       10 ....ManualResetEvent  0 instance 00000000 manualResetEvent
6f7584dc  40009b5       14        System.Object  0 instance 01c40c98 thisLock
79a77030  40009b6       18 ...viceModelActivity  0 instance 00000000 callbackActivity
79a096b0  4000e49       20 ...ersonationContext  0 instance 01c40ca4 impersonationContext
79a300b4  4000e4a       24 ....HostedThreadData  0 instance 00000000 hostedThreadData
<span style="background-color: #ffff00">6580e674  4000e4b       28 ...b.HttpApplication  0 instance 01c3d1f4 context</span>
6ee9fb70  4000e4c       2c           System.Uri  0 instance 05f08034 originalRequestUri
6ee9fb70  4000e4d       30           System.Uri  0 instance 05f081f0 requestUri
6f75ab0c  4000e4e       34         System.Int32  1 instance        0 state
6f75eadc  4000e4f       1f       System.Boolean  1 instance        0 flowContext
6f765e44  4000e43      178 ...l.WindowsIdentity  0   shared   static anonymousIdentity
    &gt;&gt; Domain:Value  01235fc0:NotInit  01292638:NotInit  &lt;&lt;
6f73ef38  4000e44      17c ...ding.WaitCallback  0   shared   static waitOnBeginRequest
    &gt;&gt; Domain:Value  01235fc0:NotInit  01292638:NotInit  &lt;&lt;
6f73ef38  4000e45      180 ...ding.WaitCallback  0   shared   static waitOnBeginRequestWithFlow
    &gt;&gt; Domain:Value  01235fc0:NotInit  01292638:NotInit  &lt;&lt;
6f735204  4000e46      184 ...g.ContextCallback  0   shared   static contextOnBeginRequest
    &gt;&gt; Domain:Value  01235fc0:NotInit  01292638:NotInit  &lt;&lt;
6f73fd5c  4000e47      188 System.AsyncCallback  0   shared   static processRequestCompleteCallback
    &gt;&gt; Domain:Value  01235fc0:NotInit  01292638:NotInit  &lt;&lt;
6f73c368  4000e48        0 ...ng.AutoResetEvent  0   shared TLstatic waitObject
    &gt;&gt; Thread:Value 26b8:01b3a4b8 2740:01b5e4fc 1e10:01b6dca4 6c8:01bdffe0 724:01be7948 188c:01c00938 240c:01c1298c 13d0:01c18964 2260:01c3fba4 20fc:01c65bd0 &lt;&lt;

0:045&gt; !do 01c3d1f4 
Name: System.Web.HttpApplication
MethodTable: 6580e674
EEClass: 65610c98
Size: 116(0x74) bytes
GC Generation: 0
(C:\Windows\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll)
Fields:
      MT    Field   Offset                 Type VT     Attr    Value Name
6580e85c  4000dde        4 ...pApplicationState  0 instance 01afaac4 _state
6580cf64  4000ddf        8 ...m.Web.HttpContext  0 instance 00000000 _initContext
6580eba0  4000de0        c ...b.HttpAsyncResult  0 instance 01c407d0 _ar
6580eb14  4000de1       10 ...pModuleCollection  0 instance 01c3d494 _moduleCollection
6eea00a0  4000dfc       14 ....EventHandlerList  0 instance 01c3e300 _events
658142c4  4000dfd       18 ...ventHandlersTable  0 instance 01c3e40c _asyncEvents
65815b14  4000dfe       1c ...ation+StepManager  0 instance 01c3f1e4 _stepManager
6f73ef38  4000dff       20 ...ding.WaitCallback  0 instance 01c3f1c4 _resumeStepsWaitCallback
6f735504  4000e00       24     System.EventArgs  0 instance 01b34924 _appEvent
6f75af14  4000e01       28 ...ections.Hashtable  0 instance 01c3d268 _handlerFactories
6f75a8f0  4000e02       2c ...ections.ArrayList  0 instance 00000000 _handlerRecycleList
6f75eadc  4000e03       68       System.Boolean  1 instance        0 _hideRequestResponse
<span style="background-color: #ffff00">6580cf64  4000e04       30 ...m.Web.HttpContext  0 instance 01c404c8 _context</span>
6f758a54  4000e05       34     System.Exception  0 instance 00000000 _lastError
6f75eadc  4000e06       69       System.Boolean  1 instance        1 _timeoutManagerInitialized



<span style="background-color: #ffff00">0:045&gt; !do 01c404c8 </span>
<span style="background-color: #ffff00">Name: System.Web.HttpContext</span>
MethodTable: 6580cf64
EEClass: 6560fff8
Size: 192(0xc0) bytes
GC Generation: 0
(C:\Windows\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll)
Fields:
      MT    Field   Offset                 Type VT     Attr    Value Name
6580e714  4000fe6        4 ...IHttpAsyncHandler  0 instance 01c3d1f4 _asyncAppHandler
6580e674  4000fe7        8 ...b.HttpApplication  0 instance 01c3d1f4 _appInstance
6580e754  4000fe8        c ....Web.IHttpHandler  0 instance 00000000 _handler
6580e9a4  4000fe9       10 ...m.Web.HttpRequest  0 instance 01c40588 _request
6580ea04  4000fea       14 ....Web.HttpResponse  0 instance 01c40634 _response
6580eac4  4000feb       18 ...HttpServerUtility  0 instance 01c40cb8 _server
6f737c24  4000fec       1c ...Collections.Stack  0 instance 00000000 _traceContextStack
658115e0  4000fed       20 ....Web.TraceContext  0 instance 00000000 _topTraceContext
6f75af14  4000fee       24 ...ections.Hashtable  0 instance 00000000 _items
6f75a8f0  4000fef       28 ...ections.ArrayList  0 instance 00000000 _errors
6f758a54  4000ff0       2c     System.Exception  0 instance 00000000 _tempError
6f75eadc  4000ff1       90       System.Boolean  1 instance        0 _errorCleared
6f740378  4000ff2       30 ...ncipal.IPrincipal  0 instance 01b34984 _user
6f75b188  4000ff3       80        System.IntPtr  1 instance        0 _pManagedPrincipal
6580e3dc  4000ff4       34 ...ofile.ProfileBase  0 instance 00000000 _Profile
6f739f0c  4000ff5       a0      System.DateTime  1 instance 01c40568 _utcTimestamp
65810df4  4000ff6       38 ...HttpWorkerRequest  0 instance 01c3fea0 _wr
6f75bd2c  4000ff7       a8 ...Services.GCHandle  1 instance 01c40570 _root
6f75b188  4000ff8       84        System.IntPtr  1 instance 10490900 _ctxPtr
65809b78  4000ff9       3c ...m.Web.VirtualPath  0 instance 00000000 _configurationPath
6f75eadc  4000ffa       91       System.Boolean  1 instance        0 _skipAuthorization
6f75b4bc  4000ffb       40 ...ation.CultureInfo  0 instance 00000000 _dynamicCulture
6f75b4bc  4000ffc       44 ...ation.CultureInfo  0 instance 00000000 _dynamicUICulture
6f75ab0c  4000ffd       88         System.Int32  1 instance        0 _serverExecuteDepth
6f737c24  4000ffe       48 ...Collections.Stack  0 instance 00000000 _handlerStack
<b>&lt;striping the rest of the output&gt;</b>


</pre>
</div>
<span lang="EN" style="font-family: 'Calibri','sans-serif'">This context is the actual HttpContext reported inside the !aspxpages pages and using this technique you can associate the WCF request processing threads with the ASP.NET worker thread that handled the request in the first place, so going back to the output given by !aspxpages pages, we can see that the HttpContext (</span><span lang="EN" style="font-family: 'Courier New';font-size: 10pt">01c404c)</span><span lang="EN" style="font-family: 'Calibri','sans-serif'"> to the below entry </span>
<div id="codeSnippetWrapper" style="text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 20px 0px 10px;width: 97.5%;font-family: 'Courier New', courier, monospace;direction: ltr;font-size: 8pt;overflow: auto;cursor: text;border: silver 1px solid;padding: 4px">

<span style="color: #ff0000">0x01c404c8</span> 11647 Sec no 25 Sec 41 200 POST /MySleepingWcfService/Service.svc

&nbsp;

</div>
<span lang="EN" style="font-family: 'Calibri','sans-serif'">So this concludes that the HttpContext </span><span lang="EN" style="font-family: 'Courier New';font-size: 10pt">01c404c8 </span><span lang="EN" style="font-family: 'Calibri','sans-serif'">for which the ASP.NET worker thread is 41 is actually getting processed on thread 45. </span>

<span lang="EN" style="font-family: 'Calibri','sans-serif'">The steps are a little lengthy but at times you really need to find this information. You can even write a debugger script to automate this whole process. </span>

<b><span lang="EN" style="font-family: 'Calibri','sans-serif'">HAPPY DEBUGGING !!!</span></b><b> </b>

&nbsp;

&nbsp;

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>EventId 4196 - Troubleshooting Crashes in COM+ Applications</title>
      <link>https://docs.microsoft.com/archive/blogs/puneetgupta/eventid-4196-troubleshooting-crashes-in-com-applications</link>
      <pubDate>Sat, 03 Jul 2010 09:11:22 GMT</pubDate>
      <dc:creator><![CDATA[PuneetG]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/puneetgupta/?p=163</guid>
      <description><![CDATA[Typically we expect that a piece of code that works once should work ALWAYS but this is not as...]]></description>
      <content:encoded><![CDATA[Typically we expect that a piece of code that works once should work ALWAYS but this is not as simple as it sounds. Even though you have tested your component or application enough, it is not always possible to test all the codepaths and all sorts of situations that can arise in an application. As a result of this you may end up seeing intermittent or unexpected crashes in your application. Today we will learn about collecting some valuable information for unexpected crashes that can happen in COM+ components and how to deal with them.

<strong><span style="text-decoration: underline">What is a Crash?</span></strong> – The term <em>CRASH </em>is used by different people in various different ways. In our(or my) definition a crash is an unexpected termination of a process as result of an unhandled exception in the code. If COM+ encounters an unhandled exception in the component code the COM+ Runtime terminates the process immediately and logs the following event in the event viewer letting the user know that a crash has happened. This is called COM+ Failfast

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/12/67/metablogapi/5383.image_2.png"><img style="border-width: 0px" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/12/67/metablogapi/0272.image_thumb.png" alt="image" width="405" height="448" border="0" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/12/67/metablogapi/5383.image_2.png"><img style="border-width: 0px" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/12/67/metablogapi/0272.image_thumb.png" alt="image" width="405" height="448" border="0" /></a>

<strong>This particular behavior of COM+ terminating the process on an unexpected error condition is termed as COM+ Failfast</strong>.

This blog will list out the steps required to troubleshoot a COM+ Failfast and it can be summarized as:-
<ol>
	<li><a href="#A_WORD_ABOUT_SYMBOLS">Generating the Symbols for the application</a></li>
	<li><a href="#CONFIGURING_DEBUGGER">Configuring the debugger to collect dumps on the right exception</a></li>
	<li><a href="#COLLECTING_DUMPS">Collecting the dump file</a></li>
	<li><a href="#ANALYZING_DUMPS">Analyzing the dump using a windows debugger</a>.</li>
	<li>Making relevant code changes to correct the problem.</li>
</ol>
Now we will look at each of the above steps in detail

To walk you through the process, I wrote a COM component in VB 6.0 and configured it in COM+.  I intentionally have some <span style="text-decoration: underline">bad code </span>in my component which is causing the component to Crash. I am calling the component from a very simple VBSCRIPT file like this.
<div style="background: white;color: black;font-family: consolas;font-size: 10pt">
<blockquote>
<pre style="margin: 0px"><span style="color: blue">Dim</span> MathComponent</pre>
<pre style="margin: 0px"><span style="color: blue">Set</span> MathComponent = Createobject(<span style="color: maroon">"Arithmetic.Maths"</span>)</pre>
<pre style="margin: 0px">wscript.echo = MathComponent.DoSomeCalculation(1,2,3)</pre>
</blockquote>
</div>
On running the above script file, I can see a crash in the DLLHOST process and the following event is logged in the event viewer.
<blockquote>Event Type:    Error
Event Source:    COM+
Event Category:    Unknown
Event ID:    4786
Date:        7/3/2010
Time:        10:56:45 AM
User:        N/A
Computer:    TURTLE86
Description:
The system has called a custom component and that component has failed and generated an exception. This indicates a problem with the custom component. Notify the developer of this component that a failure has occurred and provide them with the information below.
Component Prog ID:
Server Application ID: {9E761F3D-4C33-4158-9EC4-B3C5831D346F}
Server Application Instance ID:
{002B45BE-CAC5-4E9B-8811-B21EDD73B278}
Server Application Name: MathsApplication
The serious nature of this error has caused the process to terminate.
Exception: C0000008
Address: 0x7C8285F3
Call Stack:
ntdll!KiRaiseUserExceptionDispatcher + 0x37
ntdll!KiFastSystemCallRet + 0x0
<span style="color: #0080ff">Arithmetic!DllCanUnloadNow + 0x272
Arithmetic!DllCanUnloadNow + 0x1c4
Arithmetic!DllCanUnloadNow + 0x117
Arithmetic!DllCanUnloadNow + 0x6a
</span>OLEAUT32!DispCallFunc + 0xab
MSVBVM60!__vbaAptOffset + 0x68b
MSVBVM60!BASIC_CLASS_Invoke + 0x65
OLEAUT32!DispGetParam + 0x718
OLEAUT32!DllRegisterServer + 0x5bf
RPCRT4!NdrAsyncServerCall + 0x1e7
RPCRT4!CStdStubBuffer_Invoke + 0x82
OLEAUT32!DispGetParam + 0x5b6
ole32!StgGetIFillLockBytesOnFile + 0x13d32
ole32!StgGetIFillLockBytesOnFile + 0x13cdf
ole32!DcomChannelSetHResult + 0xaab
ole32!DcomChannelSetHResult + 0x495
ole32!CoFreeUnusedLibrariesEx + 0xb06
ole32!StgGetIFillLockBytesOnFile + 0x13bec
ole32!StgGetIFillLockBytesOnFile + 0x13a7d
ole32!StgGetIFillLockBytesOnFile + 0x12f64
ole32!CoFreeUnusedLibrariesEx + 0x9f5
ole32!CoFreeUnusedLibrariesEx + 0x9c0
USER32!LoadCursorW + 0x4cf5
USER32!LoadCursorW + 0x4e86
USER32!TranslateMessageEx + 0x10d
USER32!DispatchMessageW + 0xf
COMSVCS!DllUnregisterServer + 0x270
COMSVCS!DllUnregisterServer + 0x180
COMSVCS!DllUnregisterServer + 0xc6c
COMSVCS!DllUnregisterServer + 0xf4d
msvcrt!_endthreadex + 0xa3
kernel32!GetModuleHandleA + 0xdf</blockquote>
The above event entry also contains the callstack information for the thread on which the unhandled exception is thrown but there is just a <strong>small problem </strong>with the callstack that is shown in the Event. The callstack may or may not show you the right function names because of missing symbols. For e.g. the stack is showing me that functions from my DLL Arithmetic.dll (highlighted in blue) were called but it just showing one function name DllCanUnloadNow where as in my VB code I never wrote a function called DllCanUnloadNow(). So what is the DllCanUnloadNow function. Well that is what the debugger is able to match the closest based on the default export function table of a DLL and it needs symbols to translate the memory offsets to function names. <strong><em>Now what exactly is a symbol ???</em></strong>

<strong><span style="font-size: medium"><a name="A_WORD_ABOUT_SYMBOLS"></a>A word about symbols !!!</span></strong>

It is very critical for us to know the exact function where the problem happened (and if possible the exact line of code) and we can find that information only if we have the right symbols for our DLLs. Symbols (or pdb files) are binary files that are generated by compilers during code generation which help you translate the function offsets in a module to the RIGHT function names. More information on symbols and their importance can be found on

<a href="http://www.microsoft.com/whdc/devtools/debugging/debugstart.mspx" target="_blank">this</a> link and thousands of other articles and blogs available on the internet.

&nbsp;

In older versions of Visual Studio (as old as Visual Studio 6.0), symbols were NOT generated for DLL’s \EXE’s by default.  I just want to provide the steps needed to generate the PDB files for VB 6.0 and VC 6.0 applications.
<blockquote><b><span style="text-decoration: underline">To generate the symbols for DLL’s written in Visual Basic 6.0</span></b>
<ol>
	<li>Open the Visual Basic Project in Visual Studio 6.0.</li>
	<li>From the Project menu option select the <b>&lt;project name&gt; Properties…</b> option.</li>
	<li>Go to the third tab (Compile) and check the Checkbox for <b>Create Symbolic Debug Info</b></li>
	<li>After selecting this,<strong> Recompile the project</strong>. This time you would see a file with a .PDB extension generated with the same name as the name of the DLL and in the same folder where the DLL is generated.</li>
</ol>
<b><span style="text-decoration: underline">To generate the symbols for a VC++ DLL</span></b>
<ol>
	<li>Open the Project in Visual Studio.</li>
	<li>Go to project properties.</li>
	<li>Under the Linker Section, select the Debugging Sub Section and select YES for <b>Generate Debug Info. </b></li>
	<li><b>Rebuild the project.</b></li>
</ol>
</blockquote>
<span style="color: #ff0000"><strong>After generating the symbols for your component, it is very important that you redeploy the newer DLL that got generated to the server because for a debugger to align the symbols properly the timestamp of the PDB and the timestamp of the DLL has to match.</strong></span>

The next thing to do after deploying symbols is to use a Windows native debugger to capture a dump on the exception of interest and debug it using the symbols that we generated. There are some native debuggers available for this purpose (like WINDBG, CDB, NTSD etc.) but I will talk about the Debug Diagnostic Tool which is easy to use and understand. You can get the Debug Diagnostic tool from <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=28bd5941-c458-46f1-b24d-f60151d875a3&amp;displaylang=en" target="_blank">Microsoft download center</a> and install it on the server where you are seeing the crash.

<strong><span style="text-decoration: underline"><a name="CONFIGURING_DEBUGGER"></a>Configuring the Debugger </span></strong>

Debug Diagnostic tool lets you generate as well analyze the dumps. This tool provides you a friendly GUI that can be configured to take dumps of any process. You can follow these steps to configure dumps for the COM+ Application which is crashing.
<ol>
	<li>Launch the tool by going to Start- &gt; Programs -&gt; Debug Diagnostic Tool 1.1 -&gt;DebugDiag 1.1</li>
	<li>In the <b>Select Rule Type</b> action, select <b>Crash</b> and click Next</li>
	<li>In the <b>Select Target Type</b> section, select <b>A specific MTS/COM+ Application</b>.</li>
	<li>From the list select the COM+ Application which is experiencing the Crash.</li>
	<li>In the <b>Advanced Confirmation</b> section, click on <b>Breakpoints</b> and then click <b>Add Breakpoint</b></li>
	<li>Select <b>ComSvcs!ComSvcsExceptionFilter</b> (I will talk about this shortly) and change the <b>Action Type</b> to <b>Full User Dump</b>. You can change the <b>Action Limit</b> to 5 which configures the tool to take 5 dumps and then complete the rule.</li>
	<li>Click <b>Ok</b> and click <b>Save and Close</b></li>
	<li>Click <strong>Next </strong>and in the Select Dump Location and Rule Name dialog, you can configure a friendly rule name and specify a location on the hard drive where the dump will be generated.</li>
	<li>Click <strong>Next</strong> and <b>Finish</b> to Activate the rule. Once the wizard completes the rule should come in the Rules section with a status of <strong>Active</strong> and should look like this.</li>
</ol>
&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/12/67/metablogapi/3252.image_4.png"><img style="border-width: 0px" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/12/67/metablogapi/2678.image_thumb_1.png" alt="image" width="644" height="221" border="0" /></a>

&nbsp;

For COM+ Applications, it is better to configure the <b>ComSvcs!ComSvcsExceptionFilter</b> breakpoint because that function implements the COM+ Failfast logic. Configuring the breakpoint on this function ensures that we are getting the dumps at the right time.

<strong><span style="text-decoration: underline"><a name="COLLECTING_DUMPS"></a>Collecting the Dumps</span></strong>

At this point you just have to wait for the crash to happen again. If this is an easily reproducible issue, you may just go ahead and reproduce it once so that the debugger is able to take the dumps. Whenever the dumps are collected by this tool, you will notice the <strong>UserDump Count</strong> variable incremented by 1.

There may be multiple dumps generated by the tool based on what you configured it for but the one you are most interested to look at is the one which contains ComSvcsExceptionFilter in the name. The dump file that got generated on my machine as a result of this tool had the name

<strong><span style="font-size: xx-small">dllhost__PID__6492__Date__07_03_2010__Time_11_56_44AM__725__ComSvcs!ComSvcsExceptionFilter.dmp</span></strong>

&nbsp;

<strong><a name="ANALYZING_DUMPS"></a>Analyzing the Dump File</strong>

Now starts the fun part :-). As I mentioned before, you can use any native Windows Debugger to analyze the dump file but to keep things simple again, we can use the built in analyzer of Debug Diagnostic tool to view the relevant information about the dump file. To analyze the dump using DebugDiag, you just double click on the<strong> .dmp</strong> file that you generated in the previous step which will launch the DebugDiag analyzer automatically or you can follow these steps.
<ol>
	<li>Open Debug Diagnostic tool.</li>
	<li>Go to <strong>Advanced Analysis </strong>tab</li>
	<li>Click on <strong>Add Data </strong>Files</li>
	<li>Browse to the dump file generated in the previous step and click on <strong>Start Analysis</strong>.</li>
</ol>
The moment you click on Start Analysis, the Debug Diagnostic tool will start downloading symbol files from the Microsoft Symbol server for the relevant DLLs and after running some expert analysis on the dumps, it will launch an Internet Explorer window with the HTML report of the analysis. So running the analysis on my dump file showed me this in the DebugDiag report.
<table class="mycustomContainer" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="padding-left: 5px" valign="top" width="50%">
<table class="mycustomTable" border="0" cellspacing="2" cellpadding="2">
<tbody>
<tr class="mycustomHeader">
<td>
<table border="0" cellspacing="0" cellpadding="2" bgcolor="#818181">
<tbody>
<tr>
<td></td>
</tr>
</tbody>
</table>
</td>
<td style="padding-left: 5px" width="100%">Analysis Summary</td>
</tr>
<tr id="Table_Results">
<td class="mycustomText" width="15"></td>
<td class="row">
<table class="mycustomTable" border="1">
<tbody>
<tr class="mycustomText">
<th>Type</th>
<th>Description</th>
<th>Recommendation</th>
</tr>
<tr>
<td class="mycustomText" align="center" valign="middle"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/12/67/metablogapi/6318.image_6.png"><img style="border-width: 0px" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/12/67/metablogapi/7418.image_thumb_2.png" alt="image" width="20" height="20" border="0" /></a>   Error</td>
<td class="mycustomText">The following threads in <b>dllhost__PID__6492__Date__07_03_2010__Time_11_56_44AM__725__ComSvcs!ComSvcsExceptionFilter.dmp</b> are blocked by an <b>unhandled exception</b> which caused a <span style="color: #ff0000"><b>COM+ FailFast</b></span> to occur.<b></b>( <a href="29Thread4444"><b>13</b></a> )

<b>4.55%</b> of threads blocked</td>
<td class="mycustomText">Please see the <span style="color: #ff0000"><b>Recovered Call Stack</b></span> for thread <a href="29Thread4444"><b>13</b></a> based on the restored exception and context record passed to the exception filter.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
&nbsp;

If you click on proper thread number in the above report, you can actually see the callstack of the thread which caused the exception and notice how nicely the report is showing you the recovered callstack for the exactly exception. In my case, I see the following callstack

&nbsp;

&nbsp;
<table class="mycustomContainer" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="padding-left: 5px" valign="top" width="50%">
<table class="mycustomTable" border="0" cellspacing="2" cellpadding="2">
<tbody>
<tr id="Table_Data">
<td class="row">
<div id="Dump6492:29-s"><span style="color: #ff0000"><b>Recovered stack for thread 13</b></span>
<table class="mycustomText" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<th>Function</th>
<th>    Arg 1</th>
<th>    Arg 2</th>
<th>    Arg 3</th>
<th>  Source</th>
</tr>
<tr>
<td>ntdll!KiRaiseUserExceptionDispatcher+37</td>
<td>    <span style="font-family: courier new">7c826d49</span></td>
<td>    <span style="font-family: courier new">77e63eb3</span></td>
<td>    <span style="font-family: courier new">00000006</span></td>
<td></td>
</tr>
<tr>
<td>ntdll!KiFastSystemCall+3</td>
<td>    <span style="font-family: courier new">77e63eb3</span></td>
<td>    <span style="font-family: courier new">00000006</span></td>
<td>    <span style="font-family: courier new">0114eacc</span></td>
<td></td>
</tr>
<tr>
<td>ntdll!ZwClose+c</td>
<td>    <span style="font-family: courier new">00000006</span></td>
<td>    <span style="font-family: courier new">0114eacc</span></td>
<td>    <span style="font-family: courier new">11001d14</span></td>
<td></td>
</tr>
<tr>
<td>kernel32!CloseHandle+59</td>
</tr>
</tbody>
</table>
&lt;&gt;&lt;&gt;&lt;/&gt; &lt;/&gt;

</div></td>
<td>    <span style="font-family: courier new">00000006</span></td>
<td>    <span style="font-family: courier new">000d6df8</span></td>
<td>    <span style="font-family: courier new">000b9f98</span></td>
<td></td>
</tr>
<tr>
<td><span style="color: #ff0000">Arithmetic!DllCanUnloadNow+272</span></td>
<td><span style="color: #ff0000">    <span style="font-family: courier new">000d4cb8</span></span></td>
<td><span style="color: #ff0000">    <span style="font-family: courier new">00000001</span></span></td>
<td><span style="color: #ff0000">    <span style="font-family: courier new">00000002</span></span></td>
<td><span style="color: #ff0000">  </span></td>
</tr>
<tr>
<td><span style="color: #ff0000">Arithmetic!DllCanUnloadNow+1c4</span></td>
<td><span style="color: #ff0000">    <span style="font-family: courier new">000d4cb8</span></span></td>
<td><span style="color: #ff0000">    <span style="font-family: courier new">00000001</span></span></td>
<td><span style="color: #ff0000">    <span style="font-family: courier new">00000002</span></span></td>
<td><span style="color: #ff0000">  </span></td>
</tr>
<tr>
<td><span style="color: #ff0000">Arithmetic!DllCanUnloadNow+117</span></td>
<td><span style="color: #ff0000">    <span style="font-family: courier new">000d4cb8</span></span></td>
<td><span style="color: #ff0000">    <span style="font-family: courier new">00000001</span></span></td>
<td><span style="color: #ff0000">    <span style="font-family: courier new">00000002</span></span></td>
<td><span style="color: #ff0000">  </span></td>
</tr>
<tr>
<td><span style="color: #ff0000">Arithmetic!DllCanUnloadNow+6a</span></td>
<td><span style="color: #ff0000">    <span style="font-family: courier new">000d4cb8</span></span></td>
<td><span style="color: #ff0000">    <span style="font-family: courier new">00000001</span></span></td>
<td><span style="color: #ff0000">    <span style="font-family: courier new">00000002</span></span></td>
<td></td>
</tr>
<tr>
<td>oleaut32!DispCallFunc+16a</td>
<td>    <span style="font-family: courier new">000d4cb8</span></td>
<td>    <span style="font-family: courier new">0000001c</span></td>
<td>    <span style="font-family: courier new">00000004</span></td>
<td></td>
</tr>
<tr>
<td>msvbvm60!VBStrToLong+cf</td>
<td>    <span style="font-family: courier new">000d4cb8</span></td>
<td>    <span style="font-family: courier new">11001320</span></td>
<td>    <span style="font-family: courier new">60030000</span></td>
<td></td>
</tr>
<tr>
<td>msvbvm60!rtFindFirstFile+185</td>
<td>    <span style="font-family: courier new">000d4cb8</span></td>
<td>    <span style="font-family: courier new">60030000</span></td>
<td>    <span style="font-family: courier new">000d63dc</span></td>
<td></td>
</tr>
<tr>
<td>oleaut32!IDispatch_Invoke_Stub+52</td>
<td>    <span style="font-family: courier new">000d4cb8</span></td>
<td>    <span style="font-family: courier new">60030000</span></td>
<td>    <span style="font-family: courier new">000d63dc</span></td>
<td></td>
</tr>
<tr>
<td>oleaut32!IDispatch_RemoteInvoke_Thunk+5b</td>
<td>    <span style="font-family: courier new">0114f650</span></td>
<td>    <span style="font-family: courier new">000d52e0</span></td>
<td>    <span style="font-family: courier new">000ba4e8</span></td>
<td></td>
</tr>
<tr>
<td>rpcrt4!NdrStubCall2+214</td>
<td>    <span style="font-family: courier new">000d52e0</span></td>
<td>    <span style="font-family: courier new">000bf458</span></td>
<td>    <span style="font-family: courier new">000ba4e8</span></td>
<td></td>
</tr>
<tr>
<td>rpcrt4!CStdStubBuffer_Invoke+c6</td>
<td>    <span style="font-family: courier new">000d52e0</span></td>
<td>    <span style="font-family: courier new">000ba4e8</span></td>
<td>    <span style="font-family: courier new">000bf458</span></td>
<td></td>
</tr>
<tr>
<td>oleaut32!CStubWrapper::Invoke+9f</td>
<td>    <span style="font-family: courier new">000c14f8</span></td>
<td>    <span style="font-family: courier new">000ba4e8</span></td>
<td>    <span style="font-family: courier new">000bf458</span></td>
<td></td>
</tr>
<tr>
<td>ole32!SyncStubInvoke+37</td>
<td>    <span style="font-family: courier new">000ba4e8</span></td>
<td>    <span style="font-family: courier new">000ab790</span></td>
<td>    <span style="font-family: courier new">000bf9d0</span></td>
<td></td>
</tr>
<tr>
<td>ole32!StubInvoke+a7</td>
<td>    <span style="font-family: courier new">000ba4e8</span></td>
<td>    <span style="font-family: courier new">000b9e48</span></td>
<td>    <span style="font-family: courier new">000c14f8</span></td>
<td></td>
</tr>
<tr>
<td>ole32!CCtxComChnl::ContextInvoke+ec</td>
<td>    <span style="font-family: courier new">000bf458</span></td>
<td>    <span style="font-family: courier new">00000000</span></td>
<td>    <span style="font-family: courier new">000c14f8</span></td>
<td></td>
</tr>
<tr>
<td>ole32!MTAInvoke+1a</td>
<td>    <span style="font-family: courier new">000ba4e8</span></td>
<td>    <span style="font-family: courier new">00000001</span></td>
<td>    <span style="font-family: courier new">000c14f8</span></td>
<td></td>
</tr>
<tr>
<td>ole32!STAInvoke+48</td>
<td>    <span style="font-family: courier new">000ba4e8</span></td>
<td>    <span style="font-family: courier new">00000001</span></td>
<td>    <span style="font-family: courier new">000c14f8</span></td>
<td></td>
</tr>
<tr>
<td>ole32!AppInvoke+a3</td>
<td>    <span style="font-family: courier new">d0908070</span></td>
<td>    <span style="font-family: courier new">000bf458</span></td>
<td>    <span style="font-family: courier new">000c14f8</span></td>
<td></td>
</tr>
<tr>
<td>ole32!ComInvokeWithLockAndIPID+2c5</td>
<td>    <span style="font-family: courier new">000ba490</span></td>
<td>    <span style="font-family: courier new">000a1350</span></td>
<td>    <span style="font-family: courier new">00000400</span></td>
<td></td>
</tr>
<tr>
<td>ole32!ComInvoke+ca</td>
<td>    <span style="font-family: courier new">000ba490</span></td>
<td>    <span style="font-family: courier new">00000400</span></td>
<td>    <span style="font-family: courier new">000c71f8</span></td>
<td></td>
</tr>
<tr>
<td>ole32!ThreadDispatch+23</td>
<td>    <span style="font-family: courier new">000ba490</span></td>
<td>    <span style="font-family: courier new">0114fe0c</span></td>
<td>    <span style="font-family: courier new">776bc27c</span></td>
<td></td>
</tr>
<tr>
<td>ole32!ThreadWndProc+fe</td>
<td>    <span style="font-family: courier new">000b9b70</span></td>
<td>    <span style="font-family: courier new">00000400</span></td>
<td>    <span style="font-family: courier new">0000babe</span></td>
<td></td>
</tr>
<tr>
<td>user32!InternalCallWinProc+28</td>
<td>    <span style="font-family: courier new">776bc27c</span></td>
<td>    <span style="font-family: courier new">00550f40</span></td>
<td>    <span style="font-family: courier new">00000400</span></td>
<td></td>
</tr>
<tr>
<td>user32!UserCallWinProcCheckWow+151</td>
<td>    <span style="font-family: courier new">00000000</span></td>
<td>    <span style="font-family: courier new">776bc27c</span></td>
<td>    <span style="font-family: courier new">00550f40</span></td>
<td></td>
</tr>
<tr>
<td>user32!DispatchMessageWorker+327</td>
<td>    <span style="font-family: courier new">000cbdd4</span></td>
<td>    <span style="font-family: courier new">00000000</span></td>
<td>    <span style="font-family: courier new">0114fecc</span></td>
<td></td>
</tr>
<tr>
<td>user32!DispatchMessageW+f</td>
<td>    <span style="font-family: courier new">000cbdd4</span></td>
<td>    <span style="font-family: courier new">000cbdd0</span></td>
<td>    <span style="font-family: courier new">000cbd40</span></td>
<td></td>
</tr>
<tr>
<td>comsvcs!CSTAQueueLessMessageWork::DoWork+4e</td>
<td>    <span style="font-family: courier new">000cbd60</span></td>
<td>    <span style="font-family: courier new">000cbd40</span></td>
<td>    <span style="font-family: courier new">000cbdc4</span></td>
<td></td>
</tr>
<tr>
<td>comsvcs!CSTAThread::DoWork+18</td>
<td>    <span style="font-family: courier new">000cbdd0</span></td>
<td>    <span style="font-family: courier new">00000001</span></td>
<td>    <span style="font-family: courier new">000cbd40</span></td>
<td></td>
</tr>
<tr>
<td>comsvcs!CSTAThread::ProcessQueueWork+37</td>
<td>    <span style="font-family: courier new">00000000</span></td>
<td>    <span style="font-family: courier new">00037918</span></td>
<td>    <span style="font-family: courier new">00037a48</span></td>
<td></td>
</tr>
<tr>
<td>comsvcs!CSTAThread::WorkerLoop+190</td>
<td>    <span style="font-family: courier new">000cbd40</span></td>
<td>    <span style="font-family: courier new">00000000</span></td>
<td>    <span style="font-family: courier new">00000000</span></td>
<td></td>
</tr>
<tr>
<td>msvcrt!_endthreadex+a3</td>
<td>    <span style="font-family: courier new">00037a48</span></td>
<td>    <span style="font-family: courier new">00000000</span></td>
<td>    <span style="font-family: courier new">00000000</span></td>
<td></td>
</tr>
<tr>
<td>kernel32!BaseThreadStart+34</td>
<td>    <span style="font-family: courier new">77bcb4bc</span></td>
<td>    <span style="font-family: courier new">00037a48</span></td>
<td>    <span style="font-family: courier new">00000000</span></td>
<td></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
&nbsp;

&nbsp;

<strong>So all that is fine but why am I seeing DllCanUnloadNow and not the right function name?</strong>

&nbsp;

The reason for that is that we have not configured Debug Diagnostic to load the right symbols for my DLL. This configuration in Debug Diagnostic tool is done under the <strong>Tools </strong>menu by selecting <strong>Options and Settings. </strong>These are the default settings.

&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/12/67/metablogapi/8228.image_8.png"><img style="border-width: 0px" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/12/67/metablogapi/0118.image_thumb_3.png" alt="image" width="487" height="393" border="0" /></a>

&nbsp;

All you need to do is append the path to the folder where the PDB files for your component are to “Symbol Search Path for analysis”. So in my case, the PDB files are present inside<em> E:\COMProjects\ArithmeticComponent</em> folder, so my Symbol Search Path for analysis will become

<strong>srv*c:\symcache*http://msdl.microsoft.com/downloads/symbols<span style="color: #800080">;E:\COMProjects\ArithmeticComponent</span></strong>

Now if I run Debug Diagnostic tool again on the same report, I can see the functions reported in a better way but before doing that I would like to turn on one more setting under the <strong>Preferences</strong> tab under <strong>Options and Setting</strong> and that is selecting “<strong>Include source and line information in analysis reports</strong>”

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/12/67/metablogapi/5857.image_10.png"><img style="border-width: 0px" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/12/67/metablogapi/4705.image_thumb_4.png" alt="image" width="244" height="199" border="0" /></a>

&nbsp;

After making these changes I re-run my report and now if I look at the Recovered Callstack for Thread 13, I can see the right function names
<table class="mycustomContainer" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="padding-left: 5px" valign="top" width="50%">
<table class="mycustomTable" border="0" cellspacing="2" cellpadding="2">
<tbody>
<tr id="Table_Data">
<td class="row">
<div id="Dump6492:29-s"><span style="color: #ff0000"><b>Recovered stack for thread 13</b></span>
<table class="mycustomText" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<th>Function</th>
<th>    Arg 1</th>
<th>    Arg 2</th>
<th>    Arg 3</th>
<th>  Source</th>
</tr>
<tr>
<td>ntdll!KiRaiseUserExceptionDispatcher+37</td>
<td>    <span style="font-family: courier new">7c826d49</span></td>
<td>    <span style="font-family: courier new">77e63eb3</span></td>
<td>    <span style="font-family: courier new">00000006</span></td>
<td></td>
</tr>
<tr>
<td>ntdll!KiFastSystemCall+3</td>
<td>    <span style="font-family: courier new">77e63eb3</span></td>
<td>    <span style="font-family: courier new">00000006</span></td>
<td>    <span style="font-family: courier new">0114eacc</span></td>
<td></td>
</tr>
<tr>
<td>ntdll!ZwClose+c</td>
<td>    <span style="font-family: courier new">00000006</span></td>
<td>    <span style="font-family: courier new">0114eacc</span></td>
<td>    <span style="font-family: courier new">11001d14</span></td>
<td></td>
</tr>
<tr>
<td>kernel32!CloseHandle+59</td>
<td>    <span style="font-family: courier new">00000006</span></td>
<td>    <span style="font-family: courier new">000d6df8</span></td>
<td>    <span style="font-family: courier new">000b9f98</span></td>
<td></td>
</tr>
<tr>
<td><span style="color: #008000">Arithmetic!Maths::CallThirdFunction+59</span></td>
<td><span style="color: #008000">    <span style="font-family: courier new">000d4cb8</span></span></td>
<td><span style="color: #008000">    <span style="font-family: courier new">00000001</span></span></td>
<td><span style="color: #008000">    <span style="font-family: courier new">00000002</span></span></td>
<td><span style="color: #008000">  E:\COMProjects\ArithmeticComponent\Maths.cls @ 37 + 19</span></td>
</tr>
<tr>
<td><span style="color: #008000">Arithmetic!Maths::CallSecondFunction+58</span></td>
<td><span style="color: #008000">    <span style="font-family: courier new">000d4cb8</span></span></td>
<td><span style="color: #008000">    <span style="font-family: courier new">00000001</span></span></td>
<td><span style="color: #008000">    <span style="font-family: courier new">00000002</span></span></td>
<td><span style="color: #008000">  E:\COMProjects\ArithmeticComponent\Maths.cls @ 29 + 18</span></td>
</tr>
<tr>
<td><span style="color: #008000">Arithmetic!Maths::CallFirstFunction+58</span></td>
<td><span style="color: #008000">    <span style="font-family: courier new">000d4cb8</span></span></td>
<td><span style="color: #008000">    <span style="font-family: courier new">00000001</span></span></td>
<td><span style="color: #008000">    <span style="font-family: courier new">00000002</span></span></td>
<td><span style="color: #008000">  E:\COMProjects\ArithmeticComponent\Maths.cls @ 24 + 18</span></td>
</tr>
<tr>
<td><span style="color: #008000">Arithmetic!Maths::DoSomeCalculation+58</span></td>
<td><span style="color: #008000">    <span style="font-family: courier new">000d4cb8</span></span></td>
<td><span style="color: #008000">    <span style="font-family: courier new">00000001</span></span></td>
<td><span style="color: #008000">    <span style="font-family: courier new">00000002</span></span></td>
<td><span style="color: #008000">  E:\COMProjects\ArithmeticComponent\Maths.cls @ 19 + 18</span></td>
</tr>
<tr>
<td>oleaut32!DispCallFunc+16a</td>
<td>    <span style="font-family: courier new">000d4cb8</span></td>
<td>    <span style="font-family: courier new">0000001c</span></td>
<td>    <span style="font-family: courier new">00000004</span></td>
<td></td>
</tr>
<tr>
<td>msvbvm60!VBStrToLong+cf</td>
<td>    <span style="font-family: courier new">000d4cb8</span></td>
<td>    <span style="font-family: courier new">11001320</span></td>
<td>    <span style="font-family: courier new">60030000</span></td>
<td></td>
</tr>
<tr>
<td>msvbvm60!rtFindFirstFile+185</td>
<td>    <span style="font-family: courier new">000d4cb8</span></td>
<td>    <span style="font-family: courier new">60030000</span></td>
<td>    <span style="font-family: courier new">000d63dc</span></td>
<td></td>
</tr>
<tr>
<td>oleaut32!IDispatch_Invoke_Stub+52</td>
<td>    <span style="font-family: courier new">000d4cb8</span></td>
<td>    <span style="font-family: courier new">60030000</span></td>
<td>    <span style="font-family: courier new">000d63dc</span></td>
<td></td>
</tr>
<tr>
<td>oleaut32!IDispatch_RemoteInvoke_Thunk+5b</td>
<td>    <span style="font-family: courier new">0114f650</span></td>
<td>    <span style="font-family: courier new">000d52e0</span></td>
<td>    <span style="font-family: courier new">000ba4e8</span></td>
<td></td>
</tr>
<tr>
<td>rpcrt4!NdrStubCall2+214</td>
<td>    <span style="font-family: courier new">000d52e0</span></td>
<td>    <span style="font-family: courier new">000bf458</span></td>
<td>    <span style="font-family: courier new">000ba4e8</span></td>
<td></td>
</tr>
<tr>
<td>rpcrt4!CStdStubBuffer_Invoke+c6</td>
<td>    <span style="font-family: courier new">000d52e0</span></td>
<td>    <span style="font-family: courier new">000ba4e8</span></td>
<td>    <span style="font-family: courier new">000bf458</span></td>
<td></td>
</tr>
<tr>
<td>oleaut32!CStubWrapper::Invoke+9f</td>
<td>    <span style="font-family: courier new">000c14f8</span></td>
<td>    <span style="font-family: courier new">000ba4e8</span></td>
<td>    <span style="font-family: courier new">000bf458</span></td>
<td></td>
</tr>
<tr>
<td>ole32!SyncStubInvoke+37</td>
<td>    <span style="font-family: courier new">000ba4e8</span></td>
<td>    <span style="font-family: courier new">000ab790</span></td>
<td>    <span style="font-family: courier new">000bf9d0</span></td>
<td></td>
</tr>
<tr>
<td>ole32!StubInvoke+a7</td>
<td>    <span style="font-family: courier new">000ba4e8</span></td>
<td>    <span style="font-family: courier new">000b9e48</span></td>
<td>    <span style="font-family: courier new">000c14f8</span></td>
<td></td>
</tr>
<tr>
<td>ole32!CCtxComChnl::ContextInvoke+ec</td>
<td>    <span style="font-family: courier new">000bf458</span></td>
<td>    <span style="font-family: courier new">00000000</span></td>
<td>    <span style="font-family: courier new">000c14f8</span></td>
<td></td>
</tr>
<tr>
<td>ole32!MTAInvoke+1a</td>
<td>    <span style="font-family: courier new">000ba4e8</span></td>
<td>    <span style="font-family: courier new">00000001</span></td>
<td>    <span style="font-family: courier new">000c14f8</span></td>
<td></td>
</tr>
<tr>
<td>ole32!STAInvoke+48</td>
<td>    <span style="font-family: courier new">000ba4e8</span></td>
<td>    <span style="font-family: courier new">00000001</span></td>
<td>    <span style="font-family: courier new">000c14f8</span></td>
<td></td>
</tr>
<tr>
<td>ole32!AppInvoke+a3</td>
<td>    <span style="font-family: courier new">d0908070</span></td>
<td>    <span style="font-family: courier new">000bf458</span></td>
<td>    <span style="font-family: courier new">000c14f8</span></td>
<td></td>
</tr>
<tr>
<td>ole32!ComInvokeWithLockAndIPID+2c5</td>
<td>    <span style="font-family: courier new">000ba490</span></td>
<td>    <span style="font-family: courier new">000a1350</span></td>
<td>    <span style="font-family: courier new">00000400</span></td>
<td></td>
</tr>
<tr>
<td>ole32!ComInvoke+ca</td>
<td>    <span style="font-family: courier new">000ba490</span></td>
<td>    <span style="font-family: courier new">00000400</span></td>
<td>    <span style="font-family: courier new">000c71f8</span></td>
<td></td>
</tr>
<tr>
<td>ole32!ThreadDispatch+23</td>
<td>    <span style="font-family: courier new">000ba490</span></td>
<td>    <span style="font-family: courier new">0114fe0c</span></td>
<td>    <span style="font-family: courier new">776bc27c</span></td>
<td></td>
</tr>
<tr>
<td>ole32!ThreadWndProc+fe</td>
<td>    <span style="font-family: courier new">000b9b70</span></td>
<td>    <span style="font-family: courier new">00000400</span></td>
<td>    <span style="font-family: courier new">0000babe</span></td>
<td></td>
</tr>
<tr>
<td>user32!InternalCallWinProc+28</td>
<td>    <span style="font-family: courier new">776bc27c</span></td>
<td>    <span style="font-family: courier new">00550f40</span></td>
<td>    <span style="font-family: courier new">00000400</span></td>
<td></td>
</tr>
<tr>
<td>user32!UserCallWinProcCheckWow+151</td>
<td>    <span style="font-family: courier new">00000000</span></td>
<td>    <span style="font-family: courier new">776bc27c</span></td>
<td>    <span style="font-family: courier new">00550f40</span></td>
<td></td>
</tr>
<tr>
<td>user32!DispatchMessageWorker+327</td>
<td>    <span style="font-family: courier new">000cbdd4</span></td>
<td>    <span style="font-family: courier new">00000000</span></td>
<td>    <span style="font-family: courier new">0114fecc</span></td>
<td></td>
</tr>
<tr>
<td>user32!DispatchMessageW+f</td>
<td>    <span style="font-family: courier new">000cbdd4</span></td>
<td>    <span style="font-family: courier new">000cbdd0</span></td>
<td>    <span style="font-family: courier new">000cbd40</span></td>
<td></td>
</tr>
<tr>
<td>comsvcs!CSTAQueueLessMessageWork::DoWork+4e</td>
<td>    <span style="font-family: courier new">000cbd60</span></td>
<td>    <span style="font-family: courier new">000cbd40</span></td>
<td>    <span style="font-family: courier new">000cbdc4</span></td>
<td></td>
</tr>
<tr>
<td>comsvcs!CSTAThread::DoWork+18</td>
<td>    <span style="font-family: courier new">000cbdd0</span></td>
<td>    <span style="font-family: courier new">00000001</span></td>
<td>    <span style="font-family: courier new">000cbd40</span></td>
<td></td>
</tr>
<tr>
<td>comsvcs!CSTAThread::ProcessQueueWork+37</td>
<td>    <span style="font-family: courier new">00000000</span></td>
<td>    <span style="font-family: courier new">00037918</span></td>
<td>    <span style="font-family: courier new">00037a48</span></td>
<td></td>
</tr>
<tr>
<td>comsvcs!CSTAThread::WorkerLoop+190</td>
<td>    <span style="font-family: courier new">000cbd40</span></td>
<td>    <span style="font-family: courier new">00000000</span></td>
<td>    <span style="font-family: courier new">00000000</span></td>
<td></td>
</tr>
<tr>
<td>msvcrt!_endthreadex+a3</td>
<td>    <span style="font-family: courier new">00037a48</span></td>
<td>    <span style="font-family: courier new">00000000</span></td>
<td>    <span style="font-family: courier new">00000000</span></td>
<td></td>
</tr>
<tr>
<td>kernel32!BaseThreadStart+34</td>
<td>    <span style="font-family: courier new">77bcb4bc</span></td>
<td>    <span style="font-family: courier new">00037a48</span></td>
<td>    <span style="font-family: courier new">00000000</span></td>
<td></td>
</tr>
</tbody>
</table>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
&nbsp;

If you read carefully, I am even getting the line numbers in my Visual Basic .CLS file which tell me the exact line of code where the problem happened. Now isn't that cool !!!

Here is the complete code of my sample component
<blockquote><span style="font-size: x-small"><span style="font-family: courier new,courier">Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long</span></span>

<span style="font-size: x-small"><span style="font-family: courier new,courier"><span style="font-size: x-small">Public Function DoSomeCalculation(ByVal number1 As Integer, ByVal number2 As Integer, ByVal number3 As Integer) As Integer</span></span></span>

<span style="font-size: x-small"><span style="font-family: courier new,courier"><span style="font-size: x-small">DoSomeCalculation = CallFirstFunction(number1, number2, number3)</span></span></span>

<span style="font-size: x-small"><span style="font-family: courier new,courier"><span style="font-size: x-small">End Function</span></span></span>

<span style="font-size: x-small"><span style="font-family: courier new,courier"><span style="font-size: x-small">Function CallFirstFunction(ByVal number1 As Integer, ByVal number2 As Integer, ByVal number3 As Integer) As Integer</span></span></span>

<span style="font-size: x-small"><span style="font-family: courier new,courier"><span style="font-size: x-small">CallFirstFunction = CallSecondFunction(number1, number2, number3)</span></span></span>

<span style="font-size: x-small"><span style="font-family: courier new,courier"><span style="font-size: x-small">End Function</span></span></span>

<span style="font-size: x-small"><span style="font-family: courier new,courier"><span style="font-size: x-small">Function CallSecondFunction(ByVal number1 As Integer, ByVal number2 As Integer, ByVal number3 As Integer) As Integer</span></span></span>

<span style="font-size: x-small"><span style="font-family: courier new,courier"><span style="font-size: x-small">CallSecondFunction = CallThirdFunction(number1, number2, number3)</span></span></span>

<span style="font-size: x-small"><span style="font-family: courier new,courier"><span style="font-size: x-small">End Function</span></span></span>

<span style="font-size: x-small"><span style="font-family: courier new,courier"><span style="font-size: x-small">Function CallThirdFunction(ByVal number1 As Integer, ByVal number2 As Integer, ByVal number3 As Integer) As Integer</span></span></span>

<span style="font-size: x-small"><span style="font-family: courier new,courier"><span style="font-size: x-small">Dim sum As Integer</span></span></span>

<span style="font-size: x-small"><span style="font-family: courier new,courier"><span style="font-size: x-small">Dim returnValue As Long</span></span></span>

<span style="color: #ff0000;font-size: x-small"><span style="font-family: courier new,courier"><span style="font-size: x-small">returnValue = CloseHandle(number1 + number2 + number3)</span></span></span>

<span style="font-size: x-small"><span style="font-family: courier new,courier"><span style="font-size: x-small">CallThirdFunction = returnValue</span></span></span>

<span style="font-size: x-small"><span style="font-family: courier new,courier"><span style="font-size: x-small">End Function</span></span></span></blockquote>
&nbsp;

So you can see that I am just passing a bad value (1 + 2 + 3 = 7)  to the Kernel32's <a title="CloseHandle" href="http://msdn.microsoft.com/en-us/library/ms724211(VS.85).aspx">CloseHandle</a> API which ends up throwing the "Invalid Handle" exception.

The same steps can be used for troubleshooting crashes in COM+ Applications written in any programming language provided you generate the right symbols and you configure the debugger to point to the right symbols.

I am attaching the complete report to the end of this blog post so that you can review what else is logged in the report.

<strong><span style="font-size: medium">HAPPY DEBUGGING !!!</span></strong>

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/03/41/64/CrashHang_Report__PID_6492__0716201016530581.zip">CrashHang_Report__PID_6492__0716201016530581.zip</a>]]></content:encoded>
    </item>
    <item>
      <title>DebugDiag script to load all symbols in a dump file</title>
      <link>https://docs.microsoft.com/archive/blogs/puneetgupta/debugdiag-script-to-load-all-symbols-in-a-dump-file</link>
      <pubDate>Thu, 13 May 2010 17:52:00 GMT</pubDate>
      <dc:creator><![CDATA[PuneetG]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/puneetgupta/2010/05/13/debugdiag-script-to-load-all-symbols-in-a-dump-file/</guid>
      <description><![CDATA[At times you really need to load symbols for all modules loaded in a dump either because you want to...]]></description>
      <content:encoded><![CDATA[<p>At times you really need to load <a href="http://www.microsoft.com/whdc/devtools/debugging/debugstart.mspx" target="_blank">symbols</a> for all modules loaded in a dump either because you want to put a breakpoint on some function (which is not exported in a module or you want) or to see the right function names in call-stacks logged in the DebugDiag's log file for debugging purposes. </p> <p>The existing Crash hang Analysis scripts load symbols for modules loaded in the process but they just don't load ALL the symbols. They only load symbols for modules that required to display in the report. Also the memory analysis scripts load symbols for modules which are required for looking at the memory allocations but the below script loads modules for ALL symbols loaded in the process </p> <table border="1"> <tbody> <tr> <td> <div style="font-family: consolas; background: white; color: black; font-size: 10pt"><pre style="margin: 0px"><span style="background: yellow">&lt;%</span><span style="color: blue">@</span> <span style="color: red">Language</span> <span style="color: blue">=</span> <span style="color: blue">VBScript</span> <span style="background: yellow">%&gt;</span></pre><pre style="margin: 0px"><span style="background: yellow">&lt;%</span><span style="color: blue">@</span> <span style="color: red">Category</span> <span style="color: blue">=</span> <span style="color: blue">Load</span> <span style="color: red">Symbols</span> <span style="background: yellow">%&gt;</span></pre><pre style="margin: 0px"><span style="background: yellow">&lt;%</span><span style="color: blue">@</span> <span style="color: red">Description</span> <span style="color: blue">=</span> <span style="color: blue">Loading</span> <span style="color: red">symbols</span> <span style="color: red">for</span> <span style="color: red">all</span> <span style="color: red">modules</span> <span style="color: red">in</span> <span style="color: red">the</span> <span style="color: red">process</span> <span style="background: yellow">%&gt;</span></pre><pre style="margin: 0px"><span style="background: yellow">&lt;%</span><span style="color: blue">@</span> <span style="color: red">TopLevelScript</span> <span style="color: blue">=</span> <span style="color: blue">True</span> <span style="background: yellow">%&gt;</span></pre><pre style="margin: 0px"><span style="background: yellow">&lt;%</span> <span style="color: blue">Option</span> <span style="color: blue">Explicit</span> <span style="background: yellow">%&gt;</span></pre><pre style="margin: 0px">&nbsp;</pre><pre style="margin: 0px"><span style="background: yellow">&lt;%</span></pre><pre style="margin: 0px">&nbsp;</pre><pre style="margin: 0px"><span style="color: blue">Const</span> ANALYSIS_STEP_COUNT = 10</pre><pre style="margin: 0px"><span style="color: blue">Dim</span> g_Debugger, g_DataFile, g_Progress,g_OverallProgress,intPosition, intLen,g_ShortDumpFileName</pre><pre style="margin: 0px">&nbsp;</pre><pre style="margin: 0px"><span style="color: blue">Set</span> g_Progress = Manager.Progress</pre><pre style="margin: 0px">g_Progress.SetOverallRange 0, Manager.DataFiles.Count * ANALYSIS_STEP_COUNT</pre><pre style="margin: 0px">g_Progress.OverallPosition = 0</pre><pre style="margin: 0px">g_Progress.OverallStatus = <span style="color: maroon">""</span></pre><pre style="margin: 0px">g_Progress.CurrentStatus = <span style="color: maroon">""</span></pre><pre style="margin: 0px">g_Progress.CurrentPosition = 0</pre><pre style="margin: 0px">g_OverallProgress = 0</pre><pre style="margin: 0px">&nbsp;</pre><pre style="margin: 0px">g_Progress.OverallStatus = <span style="color: maroon">"Starting Analysis"</span></pre><pre style="margin: 0px"><span style="color: #006400">' Main analysis and reporting loop. One iteration for each dump file</span></pre><pre style="margin: 0px">&nbsp;</pre><pre style="margin: 0px">Manager.ReportInformation <span style="color: maroon">"This script is used to load symbols for all modules loaded in the dump file"</span></pre><pre style="margin: 0px">&nbsp;</pre><pre style="margin: 0px"><span style="color: blue">For</span> <span style="color: blue">Each</span> g_DataFile <span style="color: blue">In</span> Manager.DataFiles</pre><pre style="margin: 0px">&nbsp;&nbsp;&nbsp; <span style="color: blue">If</span> (UCase(Right(g_DataFile,4)) = <span style="color: maroon">".DMP"</span>) <span style="color: blue">Then</span></pre><pre style="margin: 0px">&nbsp;</pre><pre style="margin: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue">Set</span> g_Debugger = Manager.GetDebugger(g_DataFile)</pre><pre style="margin: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue">If</span> <span style="color: blue">Not</span> g_Debugger <span style="color: blue">Is</span> <span style="color: blue">Nothing</span> <span style="color: blue">Then</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </pre><pre style="margin: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006400">'Trim g_DataFile down to just the filename itself for later use</span></pre><pre style="margin: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; intPosition = InStrRev(g_DataFile, <span style="color: maroon">"\"</span>, -1, 1)</pre><pre style="margin: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; intLen = <span style="color: blue">Len</span>(g_DataFile)</pre><pre style="margin: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g_ShortDumpFileName = Right(g_DataFile, intLen - intPosition)</pre><pre style="margin: 0px">&nbsp;</pre><pre style="margin: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006400">'Go ahead and get any extension objects we'll need later</span></pre><pre style="margin: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g_Progress.OverallStatus = <span style="color: maroon">"Loading symbols for dump "</span> &amp; g_ShortDumpFileName</pre><pre style="margin: 0px">&nbsp;</pre><pre style="margin: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g_Debugger.Execute(<span style="color: maroon">"!symfix c:\symcache"</span>)</pre><pre style="margin: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g_Debugger.Execute(<span style="color: maroon">".reload"</span>)</pre><pre style="margin: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g_Debugger.Execute(<span style="color: maroon">"ld*"</span>)</pre><pre style="margin: 0px">&nbsp;</pre><pre style="margin: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Manager.Write <span style="color: maroon">"&lt;h3&gt; Finished Loading symbols for the dump file - "</span> &amp; g_DataFile &amp; <span style="color: maroon">"&lt;h3&gt;"</span></pre><pre style="margin: 0px">&nbsp;</pre><pre style="margin: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue">Else</span></pre><pre style="margin: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Manager.ReportError <span style="color: maroon">"Unable to open the file "</span> &amp; g_DataFile &amp; <span style="color: maroon">" for analysis."</span>, <span style="color: maroon">"The file is probably "</span> &amp;_</pre><pre style="margin: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: maroon">"corrupt, and a new dump file of the targeted process will have to be created to do any analysis."</span></pre><pre style="margin: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue">End</span> <span style="color: blue">If</span></pre><pre style="margin: 0px">&nbsp;&nbsp;&nbsp; Manager.CloseDebugger g_DataFile</pre><pre style="margin: 0px">&nbsp;</pre><pre style="margin: 0px">&nbsp;&nbsp;&nbsp; <span style="color: blue">End</span> <span style="color: blue">If</span></pre><pre style="margin: 0px"><span style="color: blue">Next</span></pre><pre style="margin: 0px">&nbsp;</pre><pre style="margin: 0px"><span style="background: yellow">%&gt;</span></pre></div></td></tr></tbody></table>
<table>
<p>
<p>&nbsp; </p>
<p>Just copy the above code and create a new file in C:\Program Files\DebugDiag\Scripts folder and call it LoadSymbols.asp (or download the LoadSymbols.zip file attached to this blog). Once done, the Debug Diagnostic tool UI will show you this script and you can choose dump files whole modules you want to load in the local cache and click on Start Analysis.</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/puneetgupta/WindowsLiveWriter/DebugDiagscripttoloadallsymbolsinadumpfi_5FBE/image_2.png" original-url="http://blogs.msdn.com/blogfiles/puneetgupta/WindowsLiveWriter/DebugDiagscripttoloadallsymbolsinadumpfi_5FBE/image_2.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/puneetgupta/WindowsLiveWriter/DebugDiagscripttoloadallsymbolsinadumpfi_5FBE/image_thumb.png" original-url="http://blogs.msdn.com/blogfiles/puneetgupta/WindowsLiveWriter/DebugDiagscripttoloadallsymbolsinadumpfi_5FBE/image_thumb.png" width="644" height="253"></a> </p>
<p>&nbsp;</p>
<p>Once the script finishes you should see all the symbols downloaded in the the <strong>c:\symcache</strong> folder.</p>
<p>&nbsp;</p>
<p><form></form></p>
<p>Also notice that using the same way you can write whatever debug scripts you want for analyzing your dump. In the above script there is a for loop which is iterating through every dump file that the user selects in the DebugDiag tool UI. </p>
<p><span style="color: blue">For</span> <span style="color: blue">Each</span> g_DataFile <span style="color: blue">In</span> Manager.DataFiles</p><pre style="margin: 0px">&nbsp;&nbsp;&nbsp; <span style="color: blue">If</span> (UCase(Right(g_DataFile,4)) = <span style="color: maroon">".DMP"</span>) <span style="color: blue">Then</span></pre><pre style="margin: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue">Set</span> g_Debugger = Manager.GetDebugger(g_DataFile)</pre><pre style="margin: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue">If</span> <span style="color: blue">Not</span> g_Debugger <span style="color: blue">Is</span> <span style="color: blue">Nothing</span> <span style="color: blue">Then</span></pre><pre style="margin: 0px; background: yellow">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g_Debugger.Execute(<span style="color: maroon">"vertarget"</span>)</pre><pre style="margin: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue">Else</span></pre><pre style="margin: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Manager.ReportError <span style="color: maroon">"Unable to open the file "</span> &amp; g_DataFile &amp; <span style="color: maroon">" for analysis."</span>, <span style="color: maroon">"The file is probably "</span> &amp;_</pre><pre style="margin: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: maroon">"corrupt, and a new dump file of the targeted process will have to be created to do any analysis."</span></pre><pre style="margin: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue">End</span> <span style="color: blue">If</span></pre><pre style="margin: 0px">&nbsp;&nbsp;&nbsp; Manager.CloseDebugger g_DataFile&nbsp;&nbsp;&nbsp; </pre><pre style="margin: 0px">&nbsp;&nbsp;&nbsp; <span style="color: blue">End</span> <span style="color: blue">If</span></pre><pre style="margin: 0px"><span style="color: blue">Next</span></pre>

<tbody></tbody></p>
<div></div></table>
<p>The light highlighted in yellow above shows a call to g_Debugger.Execute() which executes a debugger command and returns you the output of that command. For e.g. the above line will call vertarget on the dump file. For more information on this method, go through the documentation (DebugDiag.chm) that comes with the DebugDiag tool and look for the DbgObj object.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/01/28/56/LoadSymbols.zip" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-01-28-56/LoadSymbols.zip">LoadSymbols.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Where is the Client Certificates UI in IIS 7.0 ?</title>
      <link>https://docs.microsoft.com/archive/blogs/puneetgupta/where-is-the-client-certificates-ui-in-iis-7-0</link>
      <pubDate>Mon, 03 Aug 2009 09:42:00 GMT</pubDate>
      <dc:creator><![CDATA[PuneetG]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/puneetgupta/2009/08/03/where-is-the-client-certificates-ui-in-iis-7-0/</guid>
      <description><![CDATA[One of the things which I found missing in the IIS 7.0 user interface was the UI which lets you...]]></description>
      <content:encoded><![CDATA[<P>One of the things which I found missing in the IIS 7.0 user interface was the UI which lets you configure the Client certificate mappings for IIS. In the present world, if you want to configure the client certificate mappings for a web site, you will have to use the configuration editor and specify the certificate blob and configure the client certificate as per this <A href="http://blogs.iis.net/rlucero/archive/2008/05/23/iis-7-walkthrough-one-to-one-client-certificate-mapping-configuration.aspx" mce_href="http://blogs.iis.net/rlucero/archive/2008/05/23/iis-7-walkthrough-one-to-one-client-certificate-mapping-configuration.aspx">blog</A>. At times, getting the certificate blog in a single line itself can get tricky and it might help to just have a UI which IIS 6.0 for this configuration.</P>
<P>Though the client certificate mapping UI feature was not present in IIS 7.0, <STRONG>the IIS 7.0 UI extensibility is so powerful</STRONG> that it is easy to write something like that. I went through some of the blogs that had samples for UI Extensibility and was able to create a sample UI module that adds this functionality in the UI. </P>
<P>Once you install the MSI (for right CPU), you will be able to see this UI module in the IIS manager. This is how it shows up in the UI.</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/puneetgupta/WindowsLiveWriter/WhereistheClientCertificatesUIinIIS7.0_10E1D/image_2.png" original-url="http://blogs.msdn.com/blogfiles/puneetgupta/WindowsLiveWriter/WhereistheClientCertificatesUIinIIS7.0_10E1D/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/puneetgupta/WindowsLiveWriter/WhereistheClientCertificatesUIinIIS7.0_10E1D/image_2.png"><IMG title=image style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; DISPLAY: inline; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=265 alt=image src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/puneetgupta/WindowsLiveWriter/WhereistheClientCertificatesUIinIIS7.0_10E1D/image_thumb.png" original-url="http://blogs.msdn.com/blogfiles/puneetgupta/WindowsLiveWriter/WhereistheClientCertificatesUIinIIS7.0_10E1D/image_thumb.png" width=644 border=0 mce_src="http://blogs.msdn.com/blogfiles/puneetgupta/WindowsLiveWriter/WhereistheClientCertificatesUIinIIS7.0_10E1D/image_thumb.png"></A> </P>
<P>I tried ensuring that the UI for client certificate configuration looks exactly the same as configuration interface in IIS 6.0 so if you are already familiar with configuring the client certificate mappings in IIS 6.0, you should be able to directly use this and configure the client certificate mappings quickly.</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/puneetgupta/WindowsLiveWriter/WhereistheClientCertificatesUIinIIS7.0_10E1D/image_4.png" original-url="http://blogs.msdn.com/blogfiles/puneetgupta/WindowsLiveWriter/WhereistheClientCertificatesUIinIIS7.0_10E1D/image_4.png" mce_href="http://blogs.msdn.com/blogfiles/puneetgupta/WindowsLiveWriter/WhereistheClientCertificatesUIinIIS7.0_10E1D/image_4.png"><IMG title=image style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; DISPLAY: inline; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=476 alt=image src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/puneetgupta/WindowsLiveWriter/WhereistheClientCertificatesUIinIIS7.0_10E1D/image_thumb_1.png" original-url="http://blogs.msdn.com/blogfiles/puneetgupta/WindowsLiveWriter/WhereistheClientCertificatesUIinIIS7.0_10E1D/image_thumb_1.png" width=644 border=0 mce_src="http://blogs.msdn.com/blogfiles/puneetgupta/WindowsLiveWriter/WhereistheClientCertificatesUIinIIS7.0_10E1D/image_thumb_1.png"></A> </P>
<P><STRONG><U>Download Location</U></STRONG></P>
<P>Find the zip file attached below to this blog and run the right version (x86 or x64) on your server to install this module.</P>
<P><U>What does the installer do?</U></P>
<OL>
<LI>The installer copies a file ClientCertificateMapping.dll to inetsrv\ClientcertificateMapping folder on your IIS server.</LI>
<LI>It registers the ClientCertificateMapping.dll in the GAC on the server.</LI>
<LI>It modifies the application host.config and adds the two statements in there.</LI></OL>
<BLOCKQUOTE>
<P>Under the <SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Courier New" __designer:dtid="281474976710673">&lt;moduleProviders&gt;</SPAN> section</P></BLOCKQUOTE>
<BLOCKQUOTE>
<BLOCKQUOTE>
<P><FONT face="Courier New">&lt;add name="ClientCertificateMapping" type="ClientCertificateMapping.ClientCertificateMappingModuleProvider, ClientCertificateMapping, Version=1.0.0.0, Culture=neutral, PublicKeyToken=44f73143bf16e268" /&gt;</FONT></P></BLOCKQUOTE>
<P>And under the <SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Courier New" __designer:dtid="281474976710673">&lt;modules&gt;</SPAN>section</P></BLOCKQUOTE>
<BLOCKQUOTE>
<BLOCKQUOTE>
<P><FONT face="Courier New"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New" __designer:dtid="281474976710676">&lt;add name="ClientCertificateMapping" /&gt;</SPAN></FONT></P></BLOCKQUOTE></BLOCKQUOTE>
<P>Note: This tool will just let you configure the client certificate mappings. To make sure that the client certificate mappings works as expected, you might have to review the other settings that are are mentioned in the following links.</P>
<OL>
<LI><A title=http://blogs.iis.net/rlucero/archive/2008/05/23/iis-7-walkthrough-one-to-one-client-certificate-mapping-configuration.aspx href="http://blogs.iis.net/rlucero/archive/2008/05/23/iis-7-walkthrough-one-to-one-client-certificate-mapping-configuration.aspx" mce_href="http://blogs.iis.net/rlucero/archive/2008/05/23/iis-7-walkthrough-one-to-one-client-certificate-mapping-configuration.aspx">http://blogs.iis.net/rlucero/archive/2008/05/23/iis-7-walkthrough-one-to-one-client-certificate-mapping-configuration.aspx</A></LI>
<LI><A title=http://blogs.msdn.com/saurabh_singh/archive/2007/06/09/client-certificate-revisited-how-to-troubleshoot-client-certificate-related-issues.aspx href="http://blogs.msdn.com/saurabh_singh/archive/2007/06/09/client-certificate-revisited-how-to-troubleshoot-client-certificate-related-issues.aspx" mce_href="http://blogs.msdn.com/saurabh_singh/archive/2007/06/09/client-certificate-revisited-how-to-troubleshoot-client-certificate-related-issues.aspx">http://blogs.msdn.com/saurabh_singh/archive/2007/06/09/client-certificate-revisited-how-to-troubleshoot-client-certificate-related-issues.aspx</A></LI></OL>
<P>Some of the <U>limitations</U> of this UI module (as I see today)</P>
<UL>
<LI>I just managed to write the functionality for one-one client certificate mapping. To be very frank, I have never seen many people using the one-to-many mapping feature anyways. But based on the user-feedback, I may spend some time writing up the UI for many-to-one mapping as well.</LI>
<LI>I wasn't able to do too much testing around this functionality. If you come across any issues, do let me know via this blog entry</LI>
<LI>There is no BROWSE button when you click the Add Mapping button. I researched a little bit and came to know that generating a object browser dialog box and using the <EM>IDsObjectPicker</EM> interface in .net requires too much of code. I found some very good sample at <A href="http://www.codeplex.com/ADUI" mce_href="http://www.codeplex.com/ADUI">codeplex</A> but realized that it is too much of code and it requires a lot of Interop and Pinvoke code. For the time being, I have not used this functionality and let the user explicitly type in the user name but if this turns out to be a requirement, I can easily add it later.</LI>
<LI>Any other issues you facing using this, please let me know :)</LI></UL>
<P>In the end, I just wanted to share some of the great resources that I came across while writing this module (and creating an installer for the same)</P>
<OL>
<LI><A title=http://blogs.msdn.com/tess/archive/2008/08/28/creating-a-ui-module-for-iis7-to-watch-current-requests.aspx href="http://blogs.msdn.com/tess/archive/2008/08/28/creating-a-ui-module-for-iis7-to-watch-current-requests.aspx" mce_href="http://blogs.msdn.com/tess/archive/2008/08/28/creating-a-ui-module-for-iis7-to-watch-current-requests.aspx">http://blogs.msdn.com/tess/archive/2008/08/28/creating-a-ui-module-for-iis7-to-watch-current-requests.aspx</A></LI>
<LI><A title=http://learn.iis.net/page.aspx/441/understanding-ui-extension-authoring/ href="http://learn.iis.net/page.aspx/441/understanding-ui-extension-authoring/" mce_href="http://learn.iis.net/page.aspx/441/understanding-ui-extension-authoring/">http://learn.iis.net/page.aspx/441/understanding-ui-extension-authoring/</A></LI>
<LI><A title=http://learn.iis.net/page.aspx/175/how-to-get-started-extending-module-properties-iis-7-iis-manager/ href="http://learn.iis.net/page.aspx/175/how-to-get-started-extending-module-properties-iis-7-iis-manager/" mce_href="http://learn.iis.net/page.aspx/175/how-to-get-started-extending-module-properties-iis-7-iis-manager/">http://learn.iis.net/page.aspx/175/how-to-get-started-extending-module-properties-iis-7-iis-manager/</A></LI></OL>
<P>These links are specifically for creating the installer for this UI module</P>
<OL>
<LI><A href="http://blogs.msdn.com/nikhiln/archive/2007/04/25/post-build-script-to-fix-msi-issues-in-vista-for-vs-2005-setup-and-deployment-project.aspx" mce_href="http://blogs.msdn.com/nikhiln/archive/2007/04/25/post-build-script-to-fix-msi-issues-in-vista-for-vs-2005-setup-and-deployment-project.aspx">http://blogs.msdn.com/nikhiln/archive/2007/04/25/post-build-script-to-fix-msi-issues-in-vista-for-vs-2005-setup-and-deployment-project.aspx</A></LI>
<LI><A href="http://blogs.msdn.com/heaths/archive/2006/02/01/64-bit-managed-custom-actions-with-visual-studio.aspx" mce_href="http://blogs.msdn.com/heaths/archive/2006/02/01/64-bit-managed-custom-actions-with-visual-studio.aspx">http://blogs.msdn.com/heaths/archive/2006/02/01/64-bit-managed-custom-actions-with-visual-studio.aspx</A></LI>
<LI><A title=http://blogs.msdn.com/carlosag/archive/2008/11/10/CreatingSetupProjectForIISusingVisualStudio2008.aspx href="http://blogs.msdn.com/carlosag/archive/2008/11/10/CreatingSetupProjectForIISusingVisualStudio2008.aspx" mce_href="http://blogs.msdn.com/carlosag/archive/2008/11/10/CreatingSetupProjectForIISusingVisualStudio2008.aspx">http://blogs.msdn.com/carlosag/archive/2008/11/10/CreatingSetupProjectForIISusingVisualStudio2008.aspx</A></LI></OL>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/85/62/31/ClientCertificateMapping.zip" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-09-85-62-31/ClientCertificateMapping.zip">ClientCertificateMapping.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>The hidden tool - MSDTC Transaction Tracing</title>
      <link>https://docs.microsoft.com/archive/blogs/puneetgupta/the-hidden-tool-msdtc-transaction-tracing</link>
      <pubDate>Fri, 06 Feb 2009 09:16:50 GMT</pubDate>
      <dc:creator><![CDATA[PuneetG]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/puneetgupta/?p=164</guid>
      <description><![CDATA[If you deal with MSDTC frequently, you might have noticed an option to toggle the tracing options...]]></description>
      <content:encoded><![CDATA[If you deal with MSDTC frequently, you might have noticed an option to toggle the tracing options for transactions in the MSDTC settings but I am not sure how many are really aware of what information is logged inside the trace file and how the trace file can be converted from a binary format to a text format. The built in transaction tracing is one of the least famous (but yet a very powerful) feature of MSDTC diagnostics. This tracing logs information about various stages of transaction propagation and gives you enough information about the various outcomes of a transaction. Using this tracing, you can not only determine the various transaction managers or resource managers involved in a transaction but you can also determine the cause of a transaction abort.

The transaction tracing becomes a powerful tool when the transactions are either taking too long to run or they are getting aborted intermittently and nothing inside your application is giving you any hint around why the transaction is getting aborted. If you observe one of the following errors inside your application, I recommend using the MSDTC transaction tracing to figure out more details about your transaction
<ul>
	<li>The Microsoft Distributed Transaction Coordinator (MS DTC) has cancelled the Distributed Transaction</li>
	<li>The transaction has been implicitly committed or aborted</li>
</ul>
By default, only the long-lived transactions are traced. You can turn ON tracing for all transactions or aborted transactions based on the kind of issue you are troubleshooting. You just have to select the relevant checkboxes in the trace settings and tracing will take effect (no restart of MSDTC service is required to toggle these settings)

The next important thing becomes collecting the trace in the right manner. It is always better to collect a trace which <strong><span style="text-decoration: underline">just</span></strong> contains information about the problem that you are troubleshooting because on a busy server the Transaction trace can contain a lot of transactions and it might become very difficult to find out which transaction outcome you are interested in. So this is how we like to collect a DTC Trace.
<ol>
	<li>Open up COMPONENT SERVICES and go to the properties of My Computer. Under the MSDTC tab, click on Tracing options. After that, click on<strong> Stop Session</strong> and then click on <strong>New Session </strong>button. This will generate a new file inside c:\windows\msdtc\trace folder with name like dtctrace.log.2008-12-03-11-04-52-0226-00. So this file would basically contain information about all the transactions which have already been traced up to this point and now a new session of MSDTC trace has been started which will start capturing the Tracing information as soon as you click New Session.</li>
	<li>Reproduce the problem inside the application.</li>
	<li>Now go back to the same dialog and click on <strong>Stop Session </strong>and <strong>New session</strong>. This will generate a trace file which should contain only the information about the transactions which were running while the issue was being reproduced. If your application is the only application using DTC, you can expect this log file to contain information about your transactions and analyzing the trace would be an easy job. If there are other transactions which were also running while the trace was turned ON, those will also be logged inside the file and looking at the transaction information you will have to figure out which transactions were initiated by your application.</li>
</ol>
The MSDTC tracing is basically built on the ETW Tracing for windows and like every other ETW trace, it is a binary file which needs to be parsed using some tools. <span style="text-decoration: underline">Once you have got the DTC trace log file, you have to use two utilities inside the </span><a href="http://www.microsoft.com/downloads/details.aspx?familyid=49AE8576-9BB9-4126-9761-BA8011FABF38&amp;displaylang=en"><span style="text-decoration: underline">Windows XP Service pack 2 Support</span></a><span style="text-decoration: underline"> Tools (Tracefmt.exe and traceprt.dll) to parse the trace file.</span> <i>The sad part is that to get these utilities, you need a Windows XP machine because you can only install the <a href="http://www.microsoft.com/downloads/details.aspx?familyid=49AE8576-9BB9-4126-9761-BA8011FABF38&amp;displaylang=en">Windows XP Service pack 2 Support</a> Tools on a Windows XP machine. But after installing the setup <b>(make sure to choose the complete version of the setup)</b>, you can copy the Tracefmt.exe and traceprt.dll from “c:\Program Files \Support Tools” directory to any operating system</i>. To keep things easier, I always copy these two files to c:\windows\system32\msdtc\trace folder.

The command used to parse the trace file is
<blockquote><strong><span style="color: #ff0000">msdtcvtr –tracelog &lt;NameofTheDtcTrace.log&gt; –o OutPutFile </span></strong></blockquote>
Running the above command will parse the binary trace file and generate a text file with the name OutputFile.csv which can be opened up in any text editor.

<strong><span style="text-decoration: underline"><span style="font-size: large">Important things to note regarding MSDTCVTR command</span></span></strong>
<ol>
	<li>MSDTCVTR batch file launches <a href="http://msdn.microsoft.com/en-us/library/ms797564.aspx">TRACEFMT.exe</a> in the background passing the name of the DTCTRace.log file as one of the parameters. The TraceFMT.exe in turn uses tracerpt.dll to parse the trace file.</li>
	<li>TRACEFMT uses a MOF file called msdtctr(present in the same (C:\Windows\SYSTEM32\Msdtc\Trace) folder to parse the trace. This MOF file varies from operating system to operating system. If you run the MSDTCVTR command without the MOF switch, the MSDTCVTR.BAT file automatically picks up the C:\Windows\SYSTEM32\Msdtc\Trace\msdtctr.mof file and parses the trace as per this MOF. This means that if you collect a trace from a Windows 2003 machine and try to parse it on (let’s say), a Windows XP machine, the parsed output may be blank. To fix this problem, you can copy both the MSDTCTR.MOF file along with the DTC Trace file, that you collected earlier, to the machine where you are going to parse the file and while running the MSDTCVTR command, pass a <strong>-mof &lt;filename&gt;</strong> switch to obtain the right output.</li>
	<li>The time shown in the parsed output is as per the time zone of the machine where you “parsed” the trace file. This can become a bit confusing if the machine where the trace is collected and the machine where the trace is parsed are in a different time zone. So let’s say, you collected DTC trace on a machine which is in the Central Time zone and you are parsing the trace file on a machine which is in GMT time zone, the time field in the parsed output will be in the GMT format.</li>
</ol>
<span style="font-size: x-large"><strong><span style="text-decoration: underline">A Quick Walkthrough</span></strong></span>

To demonstrate the right way to collect a trace and to parse the same, I created a sample application using System.Transactions in .NET 2.0 and I am running the following code

<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/distributedservices/WindowsLiveWriter/ThehiddentoolMSDTCTransactionTracing_7E37/SampleCode_1.png"><img style="border-width: 0px" title="SampleCode" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/distributedservices/WindowsLiveWriter/ThehiddentoolMSDTCTransactionTracing_7E37/SampleCode_thumb_1.png" alt="SampleCode" width="572" height="228" border="0" /></a>

The code is pretty simple. I am just running a Select statement inside a TransactionScope and when the scope is disposed, I am expecting a Transaction to commit. But what I notice is that after I run the above code, my transaction is getting ABORTED (Anyone familiar with System.Transactions should be able to figure out what’s wrong in the above code snippet which ending up in Transaction abort )

So under the transaction statistics in component services where as I expected the Transaction to commit, I can see that the transaction aborted.

<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/distributedservices/WindowsLiveWriter/ThehiddentoolMSDTCTransactionTracing_7E37/Transaction_Statistics.png"><img style="border-width: 0px" title="Transaction_Statistics" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/distributedservices/WindowsLiveWriter/ThehiddentoolMSDTCTransactionTracing_7E37/Transaction_Statistics_thumb.png" alt="Transaction_Statistics" width="550" height="374" border="0" /></a>

Now being the application developer I might think that MSDTC is doing something wrong to my transaction. Well let’s just see what is happening in the background by turning ON some tracing. So I went inside component services and pulled up the MSDTC Tracing options and configured the tracing to trace for aborted transactions in this way

<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/distributedservices/WindowsLiveWriter/ThehiddentoolMSDTCTransactionTracing_7E37/TracingOptions.png"><img style="border-width: 0px" title="TracingOptions" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/distributedservices/WindowsLiveWriter/ThehiddentoolMSDTCTransactionTracing_7E37/TracingOptions_thumb.png" alt="TracingOptions" width="339" height="326" border="0" /></a>

After doing that I clicked <strong>Stop Session </strong>and <strong>New session </strong>to ensure that we have a new tracing session which will log all the transaction activity from now onwards. The moment I did this, a new file is generated in the c:\windows\system32\msdtc\trace folder.

<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/distributedservices/WindowsLiveWriter/ThehiddentoolMSDTCTransactionTracing_7E37/After_First_Stop_Session.png"><img style="border-width: 0px" title="After_First_Stop_Session" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/distributedservices/WindowsLiveWriter/ThehiddentoolMSDTCTransactionTracing_7E37/After_First_Stop_Session_thumb.png" alt="After_First_Stop_Session" width="567" height="238" border="0" /></a>

At this point, we will just ignore this newly created file as it can contain information about other transactions which might have ran in the past in which we are not interested. After this I re-ran my application and made sure that the transaction did abort and now I come back to the tracing options tab and click on <strong>Stop Session </strong>and <strong>New Session </strong>again. At this point, this is how the c:\windows\system32\msdtc\trace folder looks like.

<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/distributedservices/WindowsLiveWriter/ThehiddentoolMSDTCTransactionTracing_7E37/After_Second_Stop_Session.png"><img style="border-width: 0px" title="After_Second_Stop_Session" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/distributedservices/WindowsLiveWriter/ThehiddentoolMSDTCTransactionTracing_7E37/After_Second_Stop_Session_thumb.png" alt="After_Second_Stop_Session" width="579" height="255" border="0" /></a>

Notice that we are interested in the second file that was generated (dtctrace.log.2009-03-21-10-14-16-0011-00)  as that will contain information about the aborted transaction. Now we can parse this file using the MSDTCVTR batch file

<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/distributedservices/WindowsLiveWriter/ThehiddentoolMSDTCTransactionTracing_7E37/MSDTCVTR.png"><img style="border-width: 0px" title="MSDTCVTR" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/distributedservices/WindowsLiveWriter/ThehiddentoolMSDTCTransactionTracing_7E37/MSDTCVTR_thumb.png" alt="MSDTCVTR" width="559" height="319" border="0" /></a>

After parsing the file we will get the parsed output inside AbortedTrace.csv file and we can open it up in notepad to see what it contains. This is how the file looks like
<div style="border: 1px solid #7fbae2;width: 650px;margin-bottom: 10px">
<div style="margin: 0px;padding: 0px;border: 0px solid #7fbae2;width: 400px">
<pre>    pid=1052       ;tid=1128       ;time=03/21/2009-10:14:05.246   ;seq=14         ;eventid=TRACING_STARTED                          ;;"MSDTC is resuming the tracing of long - lived transactions"
    pid=1052       ;tid=1128       ;time=03/21/2009-10:14:05.246   ;seq=15         ;eventid=TRANSACTION_BEGUN                        ;tx_guid=35e57abd-1782-4fe2-ae59-01ffb0e9b628     ;"transaction got begun, description : ''"
    pid=1052       ;tid=1620       ;time=03/21/2009-10:14:05.246   ;seq=16         ;eventid=RM_ENLISTED_IN_TRANSACTION               ;tx_guid=35e57abd-1782-4fe2-ae59-01ffb0e9b628     ;"resource manager #1001 enlisted as transaction enlistment #1. RM guid = '5f9d03ca-2f03-49cf-9b17-7cb7962f0ef0'"
    pid=1052       ;tid=1128       ;time=03/21/2009-10:14:05.261   ;seq=17         ;eventid=<strong><span style="color: #ff0000">RECEIVED_ABORT_REQUEST_FROM_BEGINNER</span></strong>     ;tx_guid=35e57abd-1782-4fe2-ae59-01ffb0e9b628     ;"received request to abort the transaction from beginner"
    pid=1052       ;tid=1128       ;time=03/21/2009-10:14:05.261   ;seq=18         ;eventid=TRANSACTION_ABORTING                     ;tx_guid=35e57abd-1782-4fe2-ae59-01ffb0e9b628     ;"transaction is aborting"
    pid=1052       ;tid=1128       ;time=03/21/2009-10:14:05.261   ;seq=19         ;eventid=RM_ISSUED_ABORT                          ;tx_guid=35e57abd-1782-4fe2-ae59-01ffb0e9b628     ;"abort request issued to resource manager #1001 for transaction enlistment #1"
    pid=1052       ;tid=2572       ;time=03/21/2009-10:14:05.261   ;seq=20         ;eventid=RM_ACKNOWLEDGED_ABORT                    ;tx_guid=35e57abd-1782-4fe2-ae59-01ffb0e9b628     ;"received acknowledgement of abort request from the resource manager #1001 for transaction enlistment #1"
    pid=1052       ;tid=2572       ;time=03/21/2009-10:14:05.261   ;seq=21         ;eventid=TRANSACTION_ABORTED                      ;tx_guid=35e57abd-1782-4fe2-ae59-01ffb0e9b628     ;"transaction has been aborted"</pre>
</div>
</div>
A careful review of the above file gives you the following information
<ol>
	<li>The transaction identifier for our transaction is <strong>35e57abd-1782-4fe2-ae59-01ffb0e9b628. </strong></li>
	<li>The transaction started at 03/21/2009-10:14:05.246 and got aborted at 03/21/2009-10:14:05.261</li>
	<li>The fifth column in the above file shows the various events that happened for this transaction and the 6th columns gives a descriptive information about that particular event. So going through the above file, we can see that the event of interest is <strong>RECEIVED_ABORT_REQUEST_FROM_BEGINNER</strong>  which tells us that the application which started the transaction is the one which sent an ABORT request to MSDTC for the transaction.</li>
</ol>
So from this we can infer that we are doing something wrong in our application which is sending an ABORT request to MSDTC. Upon reviewing our code and going through the documentation of TransactionScope , we can see that we missed something very important. From <a href="http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx">this</a> article (see TransactionScope class)
<blockquote><span style="color: #0000ff">“When your application completes all work it wants to perform in a transaction, you should call the </span><a href="http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.complete.aspx"><span style="color: #0000ff">Complete</span></a><span style="color: #0000ff"> method only once to inform that transaction manager that it is acceptable to commit the transaction. Failing to call this method aborts the transaction.”</span></blockquote>
And the right code becomes

<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/distributedservices/WindowsLiveWriter/ThehiddentoolMSDTCTransactionTracing_7E37/SampleCodeCorrected_1.png"><img style="border-width: 0px" title="SampleCodeCorrected" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/distributedservices/WindowsLiveWriter/ThehiddentoolMSDTCTransactionTracing_7E37/SampleCodeCorrected_thumb_1.png" alt="SampleCodeCorrected" width="566" height="241" border="0" /></a>

The above example may not be the best one to give here but I am sure it will help you understand the basics of collecting a trace and how to parse it to retrieve the right information. The MSDTC trace can contain a lot of other events as well and I am pasting here some of the most common events that we see while parsing trace files from real time customer scenarios.
<table style="height: 1180px" border="1" width="1182" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="163">ABORT_DUE_TO_TRANSACTION_TIMER_EXPIRED</td>
<td valign="top" width="421">The Transaction is timing out because of the configured timeout for a transaction in DTC settings.</td>
</tr>
<tr>
<td valign="top" width="163">RECEIVED_ABORT_REQUEST_FROM_BEGINNER</td>
<td valign="top" width="421">The application which started the transaction issued an abort request to MSDTC to ABORT the transaction. In case of a transaction originating from a COM+ component, a call to ContextUtil.SetAbort will end up sending this event to MSDTC.</td>
</tr>
<tr>
<td valign="top" width="163"><span style="font-size: xx-small">TRANSACTION_PROPOGATION_FAILED_CONNECTION_DOWN_FROM_REMOTE_TM</span></td>
<td valign="top" width="421">This error is typically due to networking issues. This happens when MSDTC on one machine loses connection with MSDTC on the other machine. For more information on this event, refer <a href="http://support.microsoft.com/kb/922430">this</a> article.</td>
</tr>
<tr>
<td valign="top" width="163">TRANSACTION_PROPAGATION_FAILED_TRANSACTION_NOT_FOUND</td>
<td valign="top" width="421">This event happens when you try to commit or abort a transaction that has been already committed or aborted.</td>
</tr>
<tr>
<td valign="top" width="163">RM_ENLIST_FAILED_TOO_MANY_ENLISTS</td>
<td valign="top" width="421">DTC already has the maximum number of resources enlisted in the transaction. The maximum number of resources that can be enlisted in a transaction is 32. More information in <a href="http://msdn.microsoft.com/en-us/library/ms679810(VS.85).aspx">this</a> article.</td>
</tr>
</tbody>
</table>]]></content:encoded>
    </item>
    <item>
      <title>DCOM Error 10010 in the Event logs and SLUGGISH server performance</title>
      <link>https://docs.microsoft.com/archive/blogs/puneetgupta/dcom-error-10010-in-the-event-logs-and-sluggish-server-performance</link>
      <pubDate>Wed, 21 Jan 2009 09:22:45 GMT</pubDate>
      <dc:creator><![CDATA[PuneetG]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/puneetgupta/?p=173</guid>
      <description><![CDATA[We have come across this specific issue on Windows 2003 (post service pack 1) and Windows XP (post...]]></description>
      <content:encoded><![CDATA[We have come across this specific issue on Windows 2003 (post service pack 1) and Windows XP (post service pack 2) where the machine experiences slow performance and we observe many DCOM 10010 ERRORS in the event logs. If you are running in to this issue, you may see some of the symptoms/errors listed below.
<ul>
	<li>Doing anything takes forever. You click <strong>Start</strong> button and it responds to you after a minute (or may be more than that). Switching windows in the Taskbar takes very long.</li>
	<li>If you have IIS installed on the server, the IIS related services may not start or may hang while starting. Typically these errors appear when you try to start them.
<ul>
	<li>Trying to start the IISADMIN service throws an error - <span style="color: #008000">Windows Could not start the IIS Admin Service on Local Computer. For more information, review the system Event log. If this is a non-Microsoft service, contact the service vendor, and refer to service-specific error code –2147221164(0x80040154)</span> or <span style="color: #008000">The IIS Admin Service service terminated with service-specific error 2147746132 (0x80040154). </span></li>
	<li>If IISADMIN service is started, trying to start the World Wide Web Publishing Service hangs and the service goes into the Starting state and after some time it may throw the error - <span style="color: #008000">The World Wide Web Publishing Service service terminated with service-specific error 2148007941 (0x80080005) </span></li>
</ul>
</li>
	<li>While expanding COM+ Applications inside component services, you may get the below error
<ul>
	<li><span style="color: #008000">An error occurred while processing the last operation</span></li>
	<li><span style="color: #008000">Error code 8000FFF - Catastrophic failure</span></li>
</ul>
</li>
	<li>You observe many DCOM Errors 10010 in the event viewer (like this)
<ul>
	<li><span style="color: #008000">The server {BA126AD1-2166-11D1-B1D0-00805FC1270E} did not register with DCOM within the required timeout </span></li>
	<li><span style="color: #008000">The server {8BC3F05E-D86B-11D0-A075-00C04FB68820} did not register with DCOM within the required timeout</span></li>
</ul>
</li>
</ul>
The interesting thing to note here is that most of the components which are failing or performing slowly are the basic system components only. The GUID {BA126AD1-2166-11D1-B1D0-00805FC1270E}  is the CLISID (class id) for Network Connection Manager Class and the GUID {8BC3F05E-D86B-11D0-A075-00C04FB68820} is the CLSID for WMI. The one big common thing between all these symptoms is that all the programs which exhibit the above symptoms are dependent on DCOM.

If you end up with the symptoms/errors listed above, one quick thing to check would be the <strong>permissions on the HKCR\CLSID</strong> registry key. By default this is how the permission on that key should look like.

<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/distributedservices/WindowsLiveWriter/DCOMError10010intheEventlogsandSLUGGISHs_91E1/image_2.png"><img style="border: 0px currentColor" title="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/distributedservices/WindowsLiveWriter/DCOMError10010intheEventlogsandSLUGGISHs_91E1/image_thumb.png" alt="image" width="204" height="244" border="0" /></a>

If you are running into this issue, you will see that the USERS group is not listed in the ACL list for this registry key. You might see an account with the name RESTRICTED listed out there. To fix the problem, you can configure the ACLS on the HKCR\CLSID key in the default way. For Windows 2003, this is how the default permissions on the HKCR\CLSID should look like.
<ul>
	<li>Administrators – FULL CONTROL</li>
</ul>
<ul>
	<li>Power Users – READ</li>
</ul>
<ul>
	<li>SYSTEM – FULL CONTROL</li>
	<li>Users – READ</li>
</ul>
After making the registry change, <strong>you have to reboot the machine </strong>so that the programs can access the registry during the startup and hence function properly.

<span style="color: #0000ff">At this point, we haven't got a chance to determine the root cause of this problem. In other words, we don't know what particular action ends up removing the USERS group from the HKCR\CLSID registry key and we need your help in determining root cause. If you are able to reproduce this issue at your end, we will like to know the steps you took to reproduce this issue to figure out what CAUSES this and try to avoid it from occurring in the first place. Please feel free to post your comments at the end of this blog to let us know if you have a successful repro of this situation.</span>

<strong><span style="text-decoration: underline">PLEASE NOTE</span></strong> : The permissions on the HKCR\CLSID may not be the only cause of the errors. The errors that are listed above are very generic errors and can come in a lot of situations. The purpose of this article is to eliminate one basic cause which we come across a lot of times. If fixing the permissions on the HKCR\CLSID and then rebooting the machine, doesn't fix the issue for you, we recommend you run the Process Monitor tool and look for any kind of registry level or file level access denied’s which are happening on the server.  Otherwise check out the following list of KB articles which may point more specifically to the issue that you are facing.
<ul>
	<li>You may experience various problems after you install the Microsoft Security Bulletin MS05-051 for COM+ and MS DTC - <a href="http://support.microsoft.com/kb/909444">http://support.microsoft.com/kb/909444</a></li>
	<li>An event ID 10010 error message may be logged many times in the event log of your Windows Server 2003-based computer that is running Terminal Services - <a href="http://support.microsoft.com/kb/873375">http://support.microsoft.com/kb/873375</a></li>
	<li>FIX: You experience problems after you install Windows Server 2003 Service Pack 1 or Service Pack 2 on a server that is running Application Center 2000 - <a href="http://support.microsoft.com/kb/891330">http://support.microsoft.com/kb/891330</a></li>
	<li>You may receive an "Error code 80080005 -- server execution failed." error message when you start many COM+ applications - <a href="http://support.microsoft.com/kb/870655">http://support.microsoft.com/kb/870655</a></li>
	<li>A Windows Server 2003-based computer stops responding when you perform a backup of an Exchange Server database - <a href="http://support.microsoft.com/kb/912063">http://support.microsoft.com/kb/912063</a></li>
	<li>PRB: ASP pages do not process and DCOM event 10010 appears in the system event log <a href="http://support.microsoft.com/kb/327153/">http://support.microsoft.com/kb/327153/</a></li>
	<li>How To Troubleshoot ASP in IIS 5.0 <a href="http://support.microsoft.com/kb/309051">http://support.microsoft.com/kb/309051</a></li>
</ul>]]></content:encoded>
    </item>
  </channel>
</rss>