<?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>Andrew Hall's Microsoft Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/andrehal/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/andrehal/feed.xml</link>
    <description />
    <lastBuildDate>Tue, 16 Apr 2019 04:39:21 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>How to Profile IIS Express with Visual Studio 2010 SP1</title>
      <link>https://docs.microsoft.com/archive/blogs/andrehal/how-to-profile-iis-express-with-visual-studio-2010-sp1</link>
      <pubDate>Mon, 02 May 2011 13:21:13 GMT</pubDate>
      <dc:creator><![CDATA[Andrew B Hall - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/andrehal/2011/05/02/how-to-profile-iis-express-with-visual-studio-2010-sp1/</guid>
      <description><![CDATA[&#160;  While IIS Express support shipped in Visual Studio 2010 SP1, unfortunately profiling code...]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <p><font size="2">While IIS Express support shipped in Visual Studio 2010 SP1, unfortunately profiling code running in IIS Express does not just work out of the box.&#160; The issue is that the profiler does not “know” how to setup and launch the IIS Express process to enable the various profiling methods.&#160; If this is a blocking issue for you, fortunately this can be manually worked around to profile IIS Express.</font></p>  <p><font size="2">The instructions for how to do this, vary depending on the method of profiling you would like to use, and the target framework</font></p>  <p><font size="2"><b>CPU Sampling</b>:</font></p>  <ul>   <li><font size="2">If you’re profiling .NET 4.0 after you’ve launched your site in IIS Express, manually attach to the IISExpress.exe process (Analyze -&gt; Profiler -&gt; Attach/Detach…) and you will be collecting CPU sampling data</font> </li>    <li><font size="2">· If you’re profiling .NET &lt;= 3.5:</font>       <ul>       <li><font size="2">From a Visual Studio command prompt, type:</font>           <ul>           <li><font size="2">vsperfclrenv /sampleon</font> </li>            <li><font size="2">devenv</font> </li>         </ul>       </li>        <li><font size="2">From the instance of Visual Studio that launches, launch your site in IIS Express and manually attach as in the step for profiling .NET 4.0</font> </li>     </ul>   </li> </ul>  <p><b><font size="2">.NET Memory Profiling (Sampling)</font></b></p>  <ul>   <li><font size="2">From a Visual Studio command prompt, type:</font>       <ul>       <li><font size="2">vsperfclrenv /&lt;memory option you want—see </font><a href="http://msdn.microsoft.com/en-us/library/bb385759.aspx"><font size="2">vsperfclrenv documentation</font></a><font size="2"> for options&gt; </font></li>        <li><font size="2">devenv</font> </li>     </ul>   </li>    <li><font size="2">From the instance of Visual Studio that launches, launch your site in IIS Express and manually attach as in the CPU sampling scenarios</font> </li> </ul>  <p><b><font size="2">Instrumentation (including .NET memory instrumentation)</font></b></p>  <ul>   <li><font size="2">From a Visual Studio command prompt, type:</font>       <ul>       <li><font size="2">For method timing: vsperfclrenv /traceon            <br /><i>if you want memory, see <a href="http://msdn.microsoft.com/en-us/library/bb385759.aspx">vsperfclrenv documentation</a> for options</i></font> </li>        <li><font size="2">devenv</font> </li>        <li><a href="http://msdn.microsoft.com/en-us/library/ms182402(v=VS.100).aspx"><font size="2">vsinstr</font></a><font size="2"> &lt;your binaries that will run inside IIS Express&gt;</font> </li>        <li><a href="http://msdn.microsoft.com/en-us/library/ms182403(v=VS.100).aspx"><font size="2">vsperfcmd</font></a><font size="2"> /start:trace /output:&lt;report name&gt;</font> </li>     </ul>   </li>    <li><font size="2">From the instance of Visual Studio that launches, launch your website in IIS Express and run your scenario</font> </li>    <li><font size="2">From the command prompt type: vsperfcmd /shutdown</font> </li>    <li><font size="2">Close IIS Express</font> </li>    <li><font size="2">Open the resulting .vsp file in Visual Studio</font> </li> </ul>  <p><b><font size="2">Resource Contention Profiling</font></b></p>  <ul>   <li><font size="2">Launch your website in IIS Express</font> </li>    <li><font size="2">From a Visual Studio Command Prompt:</font>       <ul>       <li><font size="2">vsperfcmd /start:concurrency,resourceonly /output:&lt;report.vsp&gt;</font> </li>        <li><font size="2">vsperfcmd /attach:&lt;IISExpress.exe’s PID&gt;</font> </li>        <li><font size="2">Run your scenario</font> </li>        <li><font size="2">vsperfcmd /shutdown</font> </li>        <li><font size="2">close IIS Express</font> </li>     </ul>   </li>    <li><font size="2">Open the resulting .vsp file in Visual Studio</font> </li> </ul>]]></content:encoded>
    </item>
    <item>
      <title>Preventing check-ins to TFS that contain code analysis warnings</title>
      <link>https://docs.microsoft.com/archive/blogs/andrehal/preventing-check-ins-to-tfs-that-contain-code-analysis-warnings</link>
      <pubDate>Wed, 06 Apr 2011 10:58:51 GMT</pubDate>
      <dc:creator><![CDATA[Andrew B Hall - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/andrehal/2011/04/06/preventing-check-ins-to-tfs-that-contain-code-analysis-warnings/</guid>
      <description><![CDATA[&#160;  Recently we have received several questions regarding Visual Studio Code Analysis...]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <p>Recently we have received several questions regarding Visual Studio Code Analysis integration with Team Foundation Server’s check-in policy and build server, so I thought it would be helpful to clarify the behavior and expose some relatively hidden functionality.</p>  <h2>Source Control Check-in Policy</h2>  <p>The first point of confusion that often arises is about the source control check-in policy.&#160; A common question is “I have a check-in policy, so why does it let me check-in code that contains code analysis warnings?”, “I want a code analysis check-in policy, but I want to hold different projects (e.g. test and product code) to different standards, can I configure different check-in policies for different projects?”, or “How can I treat warnings as errors so I break the build on code analysis warnings?”</p>  <p>The important thing to note about the code analysis check-in policy is the rule set selected for the check-in policy sets the baseline for the minimum set of rules that must be run on the project before the code can be checked in.&#160; All this does is enforce that the rules were run on the project before a check-in, it does not in fact enforce that the code checked-in be code analysis clean for the rule set that is specified in the check-in policy, nor does it actually require that exact rule set be run, as a superset of those rules can be run as long as each rule in the check-in policy rule set was run, the check-in will not be rejected.</p>  <p>The way to prevent checking in code with code analysis warnings is to modify the action for the rules from the default of “Warning” to “Error” for the rule set on the TFS server, setting the build definition trigger to be a “Gated Check-in”, and enabling Code Analysis as part of the build.&#160; <em>NOTE</em>: taking this approach will also result in your builds breaking on code analysis warnings since you are treating them as errors.</p>  <h2>Rule Sets</h2>  <p>The first thing to do is pick the rule set(s) you want run for each project.&#160; You can either use the built in rule sets, or create your own custom.&#160;&#160; You will need to create at least one custom rule set if you want to use the same set of rules, but block check-ins for some projects, and with the same set of rules not block check-ins for other projects.&#160; The easiest way to create a custom rule set is to start from an existing rule set:</p>  <ul>   <li>Open any project’s properties page </li>    <li>Select the Code Analysis tab </li>    <li>Choose the rule set you would like to make a copy of from the rule set drop down </li>    <li>Click “Open”.&#160; <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/30/69/metablogapi/6266.image_38EA6D91.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-30-69-metablogapi/6266.image_5F00_38EA6D91.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/30/69/metablogapi/5684.image_thumb_4878A558.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-30-69-metablogapi/5684.image_5F00_thumb_5F00_4878A558.png" width="513" height="371" /></a> </li>    <li>You will now be presented with the rule set editor, from the rule set editor change the action from “Warning” to “Error”      <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/30/69/metablogapi/4606.image_7351096A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-30-69-metablogapi/4606.image_5F00_7351096A.png"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/30/69/metablogapi/1057.image_thumb_2F10A21E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-30-69-metablogapi/1057.image_5F00_thumb_5F00_2F10A21E.png" width="592" height="259" /></a> </li>    <li>When you save the modified rule set you will be presented with the “Save As…” dialogue since the built in rule sets are by default read only </li> </ul>  <p>You will now need to either place your new custom rule set on a share and set the project to use that rule set by selecting “&lt;Browse…&gt;” from the rule set dropdown, or you can drop the new custom rule set into the rule set directory (“%VS_INSTALL_DIRECTORY%\Team Tools\Static Analysis Tools\Rule Sets”) on each developer’s machine and the build server machine, and it will automatically appear as an option in the rule set dropdown.    <br />    <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/30/69/metablogapi/4604.image_40ED35EB.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-30-69-metablogapi/4604.image_5F00_40ED35EB.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/30/69/metablogapi/0407.image_thumb_67BB4C2B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-30-69-metablogapi/0407.image_5F00_thumb_5F00_67BB4C2B.png" width="508" height="336" /></a></p>  <h2>Configuring the Build Definition</h2>  <p>Next we need to configure the build definition:</p>  <ol>   <li>Set the “Trigger” to “Gated Check-in”      <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/30/69/metablogapi/1586.image_278532B1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-30-69-metablogapi/1586.image_5F00_278532B1.png"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/30/69/metablogapi/2047.image_thumb_004AE97C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-30-69-metablogapi/2047.image_5F00_thumb_5F00_004AE97C.png" width="595" height="265" /></a>       <br /></li>    <li>Under “Process”, expand “Basic” and set “Perform Code Analysis” to “Always”      <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/30/69/metablogapi/2860.image_4014D001.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-30-69-metablogapi/2860.image_5F00_4014D001.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/30/69/metablogapi/4606.image_thumb_4DE715FC.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-30-69-metablogapi/4606.image_5F00_thumb_5F00_4DE715FC.png" width="623" height="280" /></a>&#160; <br /></li> </ol>  <h2></h2>  <h1></h1>  <p>That’s it, now check-ins with code analysis warnings will be blocked for projects using the new custom rule set(s).</p>]]></content:encoded>
    </item>
    <item>
      <title>How to profile ASP.NET and Silverlight at the same time</title>
      <link>https://docs.microsoft.com/archive/blogs/andrehal/how-to-profile-asp-net-and-silverlight-at-the-same-time</link>
      <pubDate>Wed, 09 Feb 2011 19:55:11 GMT</pubDate>
      <dc:creator><![CDATA[Andrew B Hall - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/andrehal/2011/02/09/how-to-profile-asp-net-and-silverlight-at-the-same-time/</guid>
      <description><![CDATA[In Visual Studio 2010 SP1 we enabled the ability to profile Silverlight applications from the Visual...]]></description>
      <content:encoded><![CDATA[<p><font size="2">In Visual Studio 2010 SP1 we enabled the ability to profile Silverlight applications from the Visual Studio UI.&nbsp; Unfortunately there is a limitation where we cannot automatically attach to multiple processes on launch from inside Visual Studio, so you are still unable to profile ASP.NET and Silverlight at the same time without manually attaching to Internet Explorer after launch.&nbsp; Fortunately, this is relatively simple.&nbsp; </font></p> <p><font size="2">To profile both Silverlight and ASP.NET at the same time:</font></p> <ol> <li><font size="2">Launch your CPU sampling session against your ASP.NET application from Visual Studio</font>  </li><li><font size="2">In the Performance Explorer window click “Attach/Detach” <br /><br /></font><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/30/69/metablogapi/8306.image_20.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-30-69-metablogapi/8306.image_5F00_20.png"><font size="2"></font><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/30/69/metablogapi/8461.image_20.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-30-69-metablogapi/8461.image_5F00_20.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/30/69/metablogapi/0550.image_thumb_9.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-30-69-metablogapi/0550.image_5F00_thumb_5F00_9.png" width="373" height="232" /></a></a> <br /> </li><li><font size="2">Select the Internet Explorer process that is running your Silverlight application—if you only have one instance of Internet Explorer open with a single tab, the process will be the “iexplore” process <strong>without</strong> a Window Title.&nbsp; <br /><br /></font><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/30/69/metablogapi/5353.image_14.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-30-69-metablogapi/5353.image_5F00_14.png"><font size="2"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/30/69/metablogapi/1033.image_thumb_6.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-30-69-metablogapi/1033.image_5F00_thumb_5F00_6.png" width="571" height="330" /></font></a> <br /> <ul> <li><font size="2">If you have multiple instances of Internet Explorer open, or multiple tabs inside internet explorer, you can either:</font>  <ul> <li><font size="2">Try looking at the CPU consumption of your iexplore.exe processes in Task Manager</font> to see which one is most active  </li><li><font size="2">Use </font><a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx"><font size="2">Process Explorer</font></a>  <ul> <li><font size="2">Find –&gt;&nbsp; “Find Handle or DLL…” (ctrl + F)</font>  </li><li><font size="2">Search for “coreclr.dll”</font>  </li><li><font size="2">The “iexplore.exe” process with this dll loaded is the PID you want to attach to <br /><br /></font><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/30/69/metablogapi/2022.image_18.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-30-69-metablogapi/2022.image_5F00_18.png"><font size="2"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/30/69/metablogapi/0044.image_thumb_8.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-30-69-metablogapi/0044.image_5F00_thumb_5F00_8.png" width="644" height="332" /></font></a> <br /></li></ul></li></ul></li></ul> </li><li><font size="2">You are now profiling ASP.NET and Silverlight at the same time</font> </li></ol> <p><font size="2"></font></p> <p><font size="2"></font></p> <p><font size="2"></font></p> <p><font size="2"></font></p> <p><font size="2"></font></p> <p><font size="2"></font></p> <p><font size="2"></font></p> <p><font size="2"></font></p> <p><font size="2"></font></p> <p><font size="2"></font></p>]]></content:encoded>
    </item>
    <item>
      <title>Visual Studio debugger fails to catch unhandled exception for a Windows Form or WPF Application?</title>
      <link>https://docs.microsoft.com/archive/blogs/andrehal/visual-studio-debugger-fails-to-catch-unhandled-exception-for-a-windows-form-or-wpf-application</link>
      <pubDate>Tue, 11 May 2010 18:50:16 GMT</pubDate>
      <dc:creator><![CDATA[Andrew B Hall - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/andrehal/2010/05/11/visual-studio-debugger-fails-to-catch-unhandled-exception-for-a-windows-form-or-wpf-application/</guid>
      <description><![CDATA[Ever begin debugging a Windows Form to have the form close suddenly without the debugger alerting...]]></description>
      <content:encoded><![CDATA[<p>Ever begin debugging a Windows Form to have the form close suddenly without the debugger alerting you to the exception?&nbsp; Or have you ever been stepping through the Form_Load event handler (or a method called by the Form_Load event handler) in a WPF application only to have it unexpectedly bring up the form instead of stepping to the next line?&nbsp; <strong>If you have, chances are you were running an x64 version of Windows…</strong>“<strong>yes?</strong>”, <strong>keep reading to learn why; </strong>“no?” you are encountering a different issue and please let us know about it through <a href="https://connect.microsoft.com/VisualStudio/feedback/CreateFeedback.aspx">Microsoft Connect</a>.</p> <h5>Why can’t the debugger catch/break on my unhandled exception on x64 versions of Windows?</h5> <p>The reason this happens on x64 versions of Windows is a design decision by the Windows operating system; x64 versions of Windows do not allow user mode exceptions to propagate post a kernel transition on the call stack.&nbsp; What happens is when an exception is thrown in an application, it travels backward on the call stack until it either reaches an exception handler or the application’s “Main()” method.&nbsp; If the exception reaches the application’s “Main()” method without being handled, the debugger recognizes that the exception went unhandled and breaks the application where the exception occurred.&nbsp; As shown below, the Form_Load method causes a kernel transition, so when an exception thrown in a Form_Load method reaches the kernel frame on the callstack, the operating system catches the exception.&nbsp; Since the exception is caught before it reaches the “Main()” method, from the debugger’s perspective the exception was caught—the debugger is unable to determine that the exception was caught by the operating system , not the user code.</p> <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/VisualStudiodebuggerfailstocatchunhandle_E6DC/image_6.png" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/VisualStudiodebuggerfailstocatchunhandle_E6DC/image_6.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/andrehal/WindowsLiveWriter/VisualStudiodebuggerfailstocatchunhandle_E6DC/image_thumb_2.png" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/VisualStudiodebuggerfailstocatchunhandle_E6DC/image_thumb_2.png" width="891" height="550"></a> </p> <h5></h5> <h5>How can I tell if this is my problem?</h5> <p>This problem can manifest itself in different ways depending on the type of exception.&nbsp; Both Windows Forms, and WPF applications have exception handling code in the underlying framework that will catch certain types of exceptions (e.g. NullReferenceException), so in some cases your application will crash with an unhandled exception, in other cases the form will load and appear, however the Form_Load method (and all subsequent calls) will not have correctly run to completion.&nbsp; There will however be a message in the “Output” window that “A first Chance exception of type ‘&lt;exception type&gt;’ occurred in &lt;application’s name&gt;”</p> <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/VisualStudiodebuggerfailstocatchunhandle_E6DC/image_10.png" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/VisualStudiodebuggerfailstocatchunhandle_E6DC/image_10.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/andrehal/WindowsLiveWriter/VisualStudiodebuggerfailstocatchunhandle_E6DC/image_thumb_4.png" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/VisualStudiodebuggerfailstocatchunhandle_E6DC/image_thumb_4.png" width="753" height="174"></a> </p> <h5>Workaround</h5> <p>Unfortunately there isn’t a lot the debugger can do in this case since the operating system catches the exception (explained above).&nbsp; The workaround in Visual Studio is to enable “First Chance” exceptions for the exception types that are being thrown in the Form_Load method.&nbsp; To to this:</p> <ol> <li>Navigate to the “Debug” menu, and select “Exceptions”  <li>Check the “Thrown” box for the “Common Language Runtime Exceptions” row.&nbsp; (Note:&nbsp; You can expand the Exceptions using the “+” sign and only check the "Thrown” box for the desired exceptions")</li></ol> <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/VisualStudiodebuggerfailstocatchunhandle_E6DC/image_2.png" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/VisualStudiodebuggerfailstocatchunhandle_E6DC/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/andrehal/WindowsLiveWriter/VisualStudiodebuggerfailstocatchunhandle_E6DC/image_thumb.png" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/VisualStudiodebuggerfailstocatchunhandle_E6DC/image_thumb.png" width="629" height="317"></a></p>]]></content:encoded>
    </item>
    <item>
      <title>Can’t hit breakpoints in a plug-in or can’t debug .NET 2.0/3.0/3.5 from a mixed mode .exe project with Visual Studio 2010?</title>
      <link>https://docs.microsoft.com/archive/blogs/andrehal/cant-hit-breakpoints-in-a-plug-in-or-cant-debug-net-2-03-03-5-from-a-mixed-mode-exe-project-with-visual-studio-2010</link>
      <pubDate>Thu, 29 Apr 2010 15:55:00 GMT</pubDate>
      <dc:creator><![CDATA[Andrew B Hall - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/andrehal/2010/04/29/cant-hit-breakpoints-in-a-plug-in-or-cant-debug-net-2-03-03-5-from-a-mixed-mode-exe-project-with-visual-studio-2010/</guid>
      <description><![CDATA[With Visual Studio 2010 came the release of Visual Studio .NET 4.0.&nbsp; .NET 4.0 adds a lot of...]]></description>
      <content:encoded><![CDATA[<P>With Visual Studio 2010 came the release of Visual Studio .NET 4.0.&nbsp; .NET 4.0 adds a lot of great features and new capabilities; however with .NET 4.0 came a new 4.0 debug engine in Visual Studio 2010 (so there are now two managed debug engines, 2.0/3.0/3.5 and 4.0).&nbsp; Ordinarily if you are developing/debugging your managed application inside of Visual Studio and begin debugging (F5) Visual Studio knows which engine to use.&nbsp; Likewise if you are attaching to a process, Visual Studio is able to tell which version of the .NET Runtime you are running on and attaches with the appropriate managed engine.&nbsp; </P>
<P>There are two scenarios however that people have been encountering since Visual Studio 2010 released where Visual Studio cannot correctly determine which engine to attach with, and therefore uses the default of 4.0 leaving 2.0/3.0/3.5 applications “un-debuggable”; (1) <A href="http://social.msdn.microsoft.com/Forums/en-US/vsdebug/thread/22d4c3d3-bf77-40ed-8b1b-64223019f3f1" mce_href="http://social.msdn.microsoft.com/Forums/en-US/vsdebug/thread/22d4c3d3-bf77-40ed-8b1b-64223019f3f1">developing a class library plug-in for a third party application (Excel, Work, AutoCAD, etc)</A>, and (2) <A href="http://connect.microsoft.com/VisualStudio/feedback/details/554067/cannot-debug-net-2-0-3-0-3-5-code-using-f5-in-mixed-mode-from-native-c-projects-or-c-project-with-start-external-program-set-to-native-exe" mce_href="http://connect.microsoft.com/VisualStudio/feedback/details/554067/cannot-debug-net-2-0-3-0-3-5-code-using-f5-in-mixed-mode-from-native-c-projects-or-c-project-with-start-external-program-set-to-native-exe">interop debugging when launching a native .exe project</A>.&nbsp; In both cases the symptoms will be the same, you will be unable to hit breakpoints in your managed code (they will be hollow with a message that “No symbols have been loaded for this document”) as well as being unable to step into the managed code.</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/Canthitbr.exeprojectwithVisualStudio2010_D3B4/image_2.png" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/Canthitbr.exeprojectwithVisualStudio2010_D3B4/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/Canthitbr.exeprojectwithVisualStudio2010_D3B4/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/andrehal/WindowsLiveWriter/Canthitbr.exeprojectwithVisualStudio2010_D3B4/image_thumb.png" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/Canthitbr.exeprojectwithVisualStudio2010_D3B4/image_thumb.png" width=623 height=105 mce_src="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/Canthitbr.exeprojectwithVisualStudio2010_D3B4/image_thumb.png"></A> </P>
<P>As I explained above, the cause of this is the managed application is 3.5 or previous, and the debugger is attached with the 4.0 engine.&nbsp; The best workaround is to add a &lt;supportedRuntime&gt; tag to your application’s *.exe.config file.&nbsp; For example, if I am debugging the application foo.exe I would edit (or create if necessary) the foo.exe.config file in the same directory as foo.exe.&nbsp; I would then add the &lt;supportedRuntime&gt; tag with the correct version of the .NET runtime in the &lt;startup&gt; section as shown in the example below.&nbsp; This will let Visual Studio know which version of the .NET runtime you will be running (so if you are developing a class library plug-in for Excel, you would add the &lt;supportedRuntime&gt; tag to the excel.exe.config file).</P>
<P>&lt;!-- sample foo.exe.config --&gt;<BR>&lt;?xml version ="1.0"?&gt;<BR>&lt;configuration&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;startup&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;supportedRuntime version="v2.0.[version on your machine]" /&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;/startup&gt;<BR>&lt;/configuration&gt; 
<P>To determine the correct [version on your machine] look in the “C:\Windows\Microsoft.NET\Framework” directory for the most recent “v2.0.xxxxx” folder.</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/Canthitbr.exeprojectwithVisualStudio2010_D3B4/image_4.png" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/Canthitbr.exeprojectwithVisualStudio2010_D3B4/image_4.png" mce_href="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/Canthitbr.exeprojectwithVisualStudio2010_D3B4/image_4.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/andrehal/WindowsLiveWriter/Canthitbr.exeprojectwithVisualStudio2010_D3B4/image_thumb_1.png" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/Canthitbr.exeprojectwithVisualStudio2010_D3B4/image_thumb_1.png" width=435 height=295 mce_src="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/Canthitbr.exeprojectwithVisualStudio2010_D3B4/image_thumb_1.png"></A></P>]]></content:encoded>
    </item>
    <item>
      <title>Why don’t I see “Debug with Mixed” when debugging the dump of a managed process in Visual Studio 2010</title>
      <link>https://docs.microsoft.com/archive/blogs/andrehal/why-dont-i-see-debug-with-mixed-when-debugging-the-dump-of-a-managed-process-in-visual-studio-2010</link>
      <pubDate>Wed, 28 Apr 2010 13:35:00 GMT</pubDate>
      <dc:creator><![CDATA[Andrew B Hall - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/andrehal/2010/04/28/why-dont-i-see-debug-with-mixed-when-debugging-the-dump-of-a-managed-process-in-visual-studio-2010/</guid>
      <description><![CDATA[It has been well publicized that Visual Studio 2010 introduced the ability to debug dumps of managed...]]></description>
      <content:encoded><![CDATA[<P>It has been well publicized that Visual Studio 2010 introduced the ability to <A href="https://channel9.msdn.com/posts/Glucose/Hanselminutes-on-9-Debugging-Crash-Dumps-with-Tess-Ferrandez-and-VS2010/" mce_href="https://channel9.msdn.com/posts/Glucose/Hanselminutes-on-9-Debugging-Crash-Dumps-with-Tess-Ferrandez-and-VS2010/">debug dumps of managed processes in mixed mode</A> (as opposed to the old days of <A href="http://msdn.microsoft.com/en-us/library/yy6d2sxs.aspx" mce_href="http://msdn.microsoft.com/en-us/library/yy6d2sxs.aspx">native debugging + SOS in the Immediate Window</A>).&nbsp; The one fact about this new feature that often gets overlooked or forgotten is that mixed mode debugging only works for dumps of processes that were running on CLR v4.0.&nbsp; </P>
<P>You might ask, “why only do the feature halfway?”.&nbsp; The answer to this, is that the ability to debug dumps of managed processes in mixed mode required an architectural change by the CLR team that was made in v4.&nbsp; So dumps of processes that were running .NET 3.5 and previous will still need to be debugged using SOS.&nbsp; </P>
<P>Can’t remember or not sure which version of the CLR the process was running on?&nbsp; The new Visual Studio 2010 Minidump Summary page tells you:</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/WhydontIseeDebugwithMixedwhendebuggingth_F75B/image_2.png" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhydontIseeDebugwithMixedwhendebuggingth_F75B/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhydontIseeDebugwithMixedwhendebuggingth_F75B/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/andrehal/WindowsLiveWriter/WhydontIseeDebugwithMixedwhendebuggingth_F75B/image_thumb.png" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhydontIseeDebugwithMixedwhendebuggingth_F75B/image_thumb.png" width=378 height=372 mce_src="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhydontIseeDebugwithMixedwhendebuggingth_F75B/image_thumb.png"></A></P>]]></content:encoded>
    </item>
    <item>
      <title>Visual Studio 2010 Beta2 hang while debugging?</title>
      <link>https://docs.microsoft.com/archive/blogs/andrehal/visual-studio-2010-beta2-hang-while-debugging</link>
      <pubDate>Wed, 06 Jan 2010 13:02:04 GMT</pubDate>
      <dc:creator><![CDATA[Andrew B Hall - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/andrehal/2010/01/06/visual-studio-2010-beta2-hang-while-debugging/</guid>
      <description><![CDATA[Causes We have received numerous reports of Visual Studio 2010 Beta2 hanging while debugging. The...]]></description>
      <content:encoded><![CDATA[<h3>Causes</h3> <p>We have received numerous reports of Visual Studio 2010 Beta2 hanging while debugging. The two most common causes identified for this were a bug in IntelliTrace and an Internet Explorer 8 bug when debugging web applications.  <h3>IntelliTrace Hang</h3> <p>You can determine if your hang is caused by the IntelliTrace issue by disabling IntelliTrace. To do this:  <ul> <li>Navigate to “Tools -&gt; Options -&gt; IntelliTrace”  <li>Uncheck “Enable IntelliTrace”<br><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/VisualStudio2010Beta2hangwhiledebugging_B6D1/clip_image002_2.jpg" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/VisualStudio2010Beta2hangwhiledebugging_B6D1/clip_image002_2.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image002" border="0" alt="clip_image002" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/VisualStudio2010Beta2hangwhiledebugging_B6D1/clip_image002_thumb.jpg" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/VisualStudio2010Beta2hangwhiledebugging_B6D1/clip_image002_thumb.jpg" width="263" height="155"></a></li></ul> <h3>Internet Explorer 8</h3> <p>If you are debugging a web application with Internet Explorer 8, and occasionally IE hangs indefinitely after you begin debugging you may be encountering a known bug in IE8 that the IE servicing team is currently working on releasing a fix for (the fix will be available in a future IE patch). You can determine if the IE8 bug is affecting you if:  <ul> <li>Internet Explorer is frozen, but the Visual Studio UI is responsive. Visual Studio will either:  <ul> <li>Be back in “Design Mode” with a message in the Output window along the lines of “The program ‘[xxxx] Foo.exe’ has exited…”  <li>Be in “Run Mode” mode because it is attached to the wrong process (you can verify this if you are not using an express version of Visual Studio by opening the Processes window [Debug -&gt; Windows –&gt; Processes] and you will see that you are attached to a process that is not “iexplore.exe”). Click “Stop Debugging” (or “Detach Process” in the Processes Window) to detach Visual Studio from the incorrect process<br><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/VisualStudio2010Beta2hangwhiledebugging_B6D1/clip_image004_2.jpg" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/VisualStudio2010Beta2hangwhiledebugging_B6D1/clip_image004_2.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image004" border="0" alt="clip_image004" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/VisualStudio2010Beta2hangwhiledebugging_B6D1/clip_image004_thumb.jpg" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/VisualStudio2010Beta2hangwhiledebugging_B6D1/clip_image004_thumb.jpg" width="257" height="57"></a></li></ul> <li>You will need to manually terminate Internet Explorer from the Windows Task Manager</li></ul> <h3>IntelliTrace Hang Fixed</h3> <p>We believe that we have identified the cause of the IntelliTrace hang and fixed it. So if disabling IntelliTrace solves your problem and you are interested in evaluating a build with the fix before the public <a href="http://blogs.msdn.com/somasegar/archive/2009/12/17/visual-studio-2010-and-net-framework-4-beta-period-extended.aspx">Release Candidate</a> we’d love to hear from you. Note: In order to get this build you will be required to sign a Microsoft Non-Disclosure Agreement (NDA). To participate please contact me (Andrew Hall) at <a href="mailto:andrehal@microsoft.com">andrehal@microsoft.com</a>  <p>If disabling IntelliTrace does not solve your problem, we’d like to know about that too so we can determine the cause of your hang. Please contact me at <a href="mailto:andrehal@microsoft.com">andrehal@microsoft.com</a> as well and I will provide instructions to help us diagnose your issue.</p>]]></content:encoded>
    </item>
    <item>
      <title>What is a dump, and how do I create one?</title>
      <link>https://docs.microsoft.com/archive/blogs/andrehal/what-is-a-dump-and-how-do-i-create-one</link>
      <pubDate>Thu, 31 Dec 2009 11:30:00 GMT</pubDate>
      <dc:creator><![CDATA[Andrew B Hall - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/andrehal/2009/12/31/what-is-a-dump-and-how-do-i-create-one/</guid>
      <description><![CDATA[What is a dump and how is it useful?

A dump is a snapshot of an application at the point in time...]]></description>
      <content:encoded><![CDATA[<H3>What is a dump and how is it useful?</H3>
<P><B></B>
<P>A dump is a snapshot of an application at the point in time the dump is taken. It shows what was executing, what modules are loaded, and if saved with heap contains a snapshot of what was in the application’s memory at that point in time making a dump with heap potentially more useful for diagnosing an issue (dumps with heap do however have the disadvantage of being much larger files making them harder to upload/email). Dumps are primarily used for debugging issues that occur only machines the developer does not have access to (e.g. a crash occurs when running on a customer’s computer, but does not occur on the developer’s computer). Dumps are not only useful for crashes, another common example is capturing a dump of an application that is hung. 
<H3>How to create a dump</H3>
<P><B></B>
<P>There are many tools for creating dumps, the easiest method is using the Task Manager on Windows Vista and up (this has significant drawbacks in many cases however as I will explain below), followed by <A href="http://technet.microsoft.com/en-us/sysinternals/dd996900.aspx" mce_href="http://technet.microsoft.com/en-us/sysinternals/dd996900.aspx">Windows Systinternals ProcDump</A> (free from Microsoft) but since this is a Visual Studio Debugger blog, I will also show how to use Visual Studio to collect a dump. 
<P><B></B>
<P>A dump is ultimately created by Windows regardless of the tool used to create it, so “a dump is a dump” regardless of what tool is used (there is one exception to this when using Task Manger on a 64bit operating system to create a dump of a 32bit process--explained in the “Creating a dump using Task Manager” section). 
<P>Since ProcDump is the most configurable tool for collecting dumps, and is relatively easy to obtain and use, I will explain how to collect dumps with ProcDump first. 
<H4>Creating a dump using ProcDump</H4>
<P>ProcDump is a command line tool for collecting dumps that is freely available from Microsoft.&nbsp; Applications can either be launched with ProcDump (very useful if the application is crashing on startup), or attached to with ProcDump.&nbsp; Additionally ProcDump can immediately collect a dump in the case of attaching to a process, or be configured to collect a dump when a variety of conditions are met (the application crashes, hangs, uses too much CPU/memory, etc).&nbsp; The full description and functionality are documented on the <A href="http://technet.microsoft.com/en-us/sysinternals/dd996900.aspx" mce_href="http://technet.microsoft.com/en-us/sysinternals/dd996900.aspx">Systinternals ProcDump page</A></P>
<H5>Collecting a dump with ProcDump</H5>
<P><B></B>
<OL>
<LI>Download procdump.zip from <A href="http://technet.microsoft.com/en-us/sysinternals/dd996900.aspx" mce_href="http://technet.microsoft.com/en-us/sysinternals/dd996900.aspx">http://technet.microsoft.com/en-us/sysinternals/dd996900.aspx</A><BR>&nbsp;<A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_D202/image_6.png" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_D202/image_6.png" mce_href="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_D202/image_6.png"><IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=image border=0 alt=image src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_D202/image_thumb_2.png" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_D202/image_thumb_2.png" width=418 height=358 mce_src="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_D202/image_thumb_2.png"></A> 
<LI>Unzip procdump.zip 
<LI>From a command prompt, navigate to the folder where you unzipped procdump 
<LI>Launch procdump.exe with the appropriate arguments for your scenario.&nbsp; Below I list a few of the most common arguments, however a full list is available on the <A href="http://technet.microsoft.com/en-us/sysinternals/dd996900.aspx" mce_href="http://technet.microsoft.com/en-us/sysinternals/dd996900.aspx">ProcDump page</A>):<BR></LI>
<OL><STRONG>-e&nbsp;&nbsp;&nbsp;&nbsp; </STRONG>Write a dump when the process encounters an unhandled exception. <BR><STRONG>-h</STRONG>&nbsp;&nbsp;&nbsp;&nbsp; Write dump if process has a hung window (does not respond to window messages for at least 5 seconds). <BR><STRONG>-ma</STRONG>&nbsp; Write a dump file with all process memory. The default dump format includes thread and handle information. <BR><STRONG>-x</STRONG>&nbsp;&nbsp;&nbsp;&nbsp; Launch the specified application </OL></OL>
<H5>Examples of collecting a dump with ProcDump</H5>
<P><STRONG>Launch an application with ProcDump and collect a dump with heap when the process crashes:</STRONG></P>
<P>C:\&gt;procdump –e –ma –x “C:\My Applications\CrashingApp.exe” crash.dmp</P>
<P><STRONG>Attach to an application that is hung and collect a dump with heap immediately:</STRONG></P>
<P>C:\&gt;procdump –ma HangingApplication.exe hang.dmp</P>
<P><STRONG>Launch an application with ProcDump and collect a dump with heap when process either crashes or hangs</STRONG></P>
<P>C:\procdump –e –h –ma –x “C:\My Applications\Application1.exe”</P>
<P><EM>Example of attaching to Visual Studio using ProcDump to collect a dump on an unhandled exception</EM><BR><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_D202/image_2.png" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_D202/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_D202/image_2.png"><IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=image border=0 alt=image src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_D202/image_thumb.png" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_D202/image_thumb.png" width=522 height=215 mce_src="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_D202/image_thumb.png"></A> </P>
<H4>Creating a dump using Visual Studio</H4>
<P><B></B>
<OL>
<LI>Open Visual Studio 
<LI>Select “Tools-&gt;Attach to Process”<BR><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image001_2.png" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image001_2.png" mce_href="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image001_2.png"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=clip_image001 border=0 alt=clip_image001 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image001_thumb.png" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image001_thumb.png" width=244 height=65 mce_src="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image001_thumb.png"></A> 
<LI>Click the “Select…” button for “Attach to:”<BR><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image003_2.jpg" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image003_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image003_2.jpg"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=clip_image003 border=0 alt=clip_image003 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image003_thumb.jpg" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image003_thumb.jpg" width=244 height=167 mce_src="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image003_thumb.jpg"></A> 
<LI>Select “Debug these code types:” 
<LI>Select “Native” (<I>Note: Native is used because in versions of Visual Studio prior to 2010 the option to save a dump is not available with the managed engine. Since the dump is created by windows, it does not matter which debug engine is attached to the application</I>) 
<LI>Click OK on the “Select Code Type” dialogue<BR><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image005_2.jpg" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image005_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image005_2.jpg"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=clip_image005 border=0 alt=clip_image005 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image005_thumb.jpg" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image005_thumb.jpg" width=244 height=131 mce_src="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image005_thumb.jpg"></A> 
<LI>Click “Attach” 
<LI>Depending on if you want to create: 
<UL>
<LI>A crash dump: 
<UL>
<LI>Reproduce the crash in the application that you are attached to. 
<LI>The instance of Visual Studio attached to the application will display a dialogue asking if you would like to “Break” or “Continue” 
<LI>Click “Break”<BR><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image007_2.jpg" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image007_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image007_2.jpg"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=clip_image007 border=0 alt=clip_image007 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image007_thumb.jpg" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image007_thumb.jpg" width=244 height=68 mce_src="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image007_thumb.jpg"></A></LI></UL>
<LI>A non-crash dump (e.g. a hung process) 
<UL>
<LI>Click “Break All” (click the “pause” icon, or select “Debug -&gt; Break All”)<BR><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image009_2.jpg" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image009_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image009_2.jpg"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=clip_image009 border=0 alt=clip_image009 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image009_thumb.jpg" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image009_thumb.jpg" width=244 height=88 mce_src="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image009_thumb.jpg"></A></LI></UL></LI></UL>
<LI>On the Debug menu, select “Save Dump As…”<BR><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image011_2.jpg" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image011_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image011_2.jpg"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=clip_image011 border=0 alt=clip_image011 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image011_thumb.jpg" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image011_thumb.jpg" width=168 height=244 mce_src="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image011_thumb.jpg"></A> 
<LI>Choose where to save the dump file, and whether you want a dump “with heap” or “without heap” (In Visual Studio 2008 the default is “without heap”, in Visual Studio 2010 the default is “with heap”)<BR><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image013_2.jpg" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image013_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image013_2.jpg"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=clip_image013 border=0 alt=clip_image013 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image013_thumb.jpg" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image013_thumb.jpg" width=244 height=184 mce_src="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image013_thumb.jpg"></A></LI></OL>
<H4>Creating a dump using Task Manager</H4>
<P><B></B>
<P>Beginning in Windows Vista, the Windows Task Manager includes support for creating dump files. This can be very useful, and is slightly quicker and less complicated than creating a dump using ProcDump or Visual Studio; there are however a few things to note when using Task Manager to create dumps. 
<UL>
<LI>Task Manager always creates a dump with heap 
<LI>If the application has crashed, Task Manager does not include the exception information in the dump 
<LI>On a 64bit operating system, dumps taken with Task Manager of 32bit processes cannot be debugged with Visual Studio because Task Manager saves the dump as a 64bit dump of the 32bit process. In the case of a 64bit OS and a 32bit process dumps should be taken using ProcDump or Visual Studio as described above (for a 64bit dump of a 32bit process <A href="http://www.microsoft.com/whdc/devtools/debugging/default.mspx" mce_href="http://www.microsoft.com/whdc/devtools/debugging/default.mspx">windbg</A> must be used)</LI></UL>
<H5>To create a dump using Task Manager:</H5>
<OL>
<LI>Open the “Windows Task Manager” 
<LI>Select the “Processes” tab 
<LI>Right click the process you wish to take a dump of 
<LI>Select “Create Dump File”<BR><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image015_2.jpg" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image015_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image015_2.jpg"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=clip_image015 border=0 alt=clip_image015 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image015_thumb.jpg" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image015_thumb.jpg" width=244 height=205 mce_src="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image015_thumb.jpg"></A> 
<LI>A dialogue will appear with the location of the saved dump (The file location can be selected and then copied and pasted).<BR><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image016_2.png" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image016_2.png" mce_href="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image016_2.png"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=clip_image016 border=0 alt=clip_image016 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image016_thumb.png" original-url="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image016_thumb.png" width=244 height=118 mce_src="http://blogs.msdn.com/blogfiles/andrehal/WindowsLiveWriter/WhatisadumpandhowdoIcreateone_B71E/clip_image016_thumb.png"></A></LI></OL>
<H3>Frequently Asked Questions Regarding Dumps:</H3>
<P><STRONG>Q:</STRONG> Can Visual Studio debug dumps of applications written in managed code?<BR><STRONG>A:</STRONG> Yes (kind of), support was added to Visual Studio 2010 to debug dumps of managed applications using CLR version 4, Visual Studio cannot debug dumps of managed applications running on versions of the CLR prior to v4 
<P><STRONG>Q:</STRONG> Can Visual Studio debug dumps of 64bit processes?<BR><STRONG>A:</STRONG> Yes, Visual Studio can debug dumps of both 64 and 32 bit processes 
<P><B></B>
<P><STRONG>Q:</STRONG> Do I have to debug a 64bit dump on a 64bit operating system?<BR><STRONG>A:</STRONG> Yes, you must be running on a 64bit operating system to debug a 64bit dump </P>]]></content:encoded>
    </item>
  </channel>
</rss>