<?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>Troubleshooting</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/yash/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/yash/feed.xml</link>
    <description />
    <lastBuildDate>Thu, 30 Jul 2015 20:32:21 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Visual Studio 2010 Profiler</title>
      <link>https://docs.microsoft.com/archive/blogs/yash/visual-studio-2010-profiler</link>
      <pubDate>Wed, 17 Mar 2010 07:25:00 GMT</pubDate>
      <dc:creator><![CDATA[Prabhatyash]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/yash/2010/03/17/visual-studio-2010-profiler/</guid>
      <description><![CDATA[Some of you might be wondering what is the use of a profiler. I am a good programmer and my...]]></description>
      <content:encoded><![CDATA[<FONT size=2 face=verdana,geneva>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 9pt">Some of you might be wondering what is the use of a profiler. I am a good programmer and my application is running without any trouble. Why shall I use the profiler?<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 9pt">Think of a scenario where you have developed an application which is going to be deployed on a production server and several hundred of users are going to use it. How can you verify that the application will be working perfectly as expected?<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 9pt">Take another scenario where some of the users are complaining about the application slow performance. How can you identify and correct the performance bottleneck? Which function is causing the issue? Which line to correct?<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 9pt">Visual Studio profiler is an answer for such scenarios. To know more about&nbsp;profiler you may need to read the <A href="http://msdn.microsoft.com/en-us/magazine/cc337887.aspx">MSDN</A> link.<o:p></o:p></SPAN></P>
<P><SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 9pt; mso-fareast-font-family: Calibri; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">This walkthrough is an effort to present some important features of the profiler, introduced in Visual Studio 2010, which can help the developers/testers improve application performance.</SPAN><STRONG>&nbsp;</STRONG></FONT></P>
<P><FONT size=2 face=verdana,geneva><STRONG>Brief Summary of features:</STRONG></FONT> </P>
<UL>
<LI><FONT face=verdana,geneva>No need to setup environment variables for "<STRONG>Attach Profiler to Process</STRONG>".</FONT></LI>
<LI><FONT face=verdana,geneva><STRONG>Start Performance Analysis</STRONG> easily.</FONT></LI>
<LI><FONT face=verdana,geneva><STRONG>Profiling In Progress</STRONG> - do simple operations while profiling is done.</FONT></LI>
<LI><FONT face=verdana,geneva><STRONG>Profiler Summary Page</STRONG> - get an overview of the results.</FONT></LI>
<LI><FONT face=verdana,geneva><STRONG>Function Details View</STRONG> - peep into the code and get function level details with the profiler.</FONT></LI>
<LI><FONT face=verdana,geneva><STRONG>Profiler Guidance Rule</STRONG> - remove bottleneck by analyzing the code and get expert advice.</FONT></LI></UL>
<P mce_keep="true"><FONT face=verdana,geneva><STRONG>Attach Profiler to Process:</STRONG></FONT></P>
<P><FONT face=verdana,geneva>You can now attach profiler to an already running managed application. With earlier version, there was a need to setup environment variables correctly. This is not a requirement in Visual Studio 2010. </FONT></P>
<UL>
<LI><FONT face=verdana,geneva>Run the managed application.</FONT></LI>
<LI><FONT face=verdana,geneva>Attach the process. (Analyze&gt;Profiler&gt;Attach). <A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9980398.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9980398.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/prabhatt/picture9980398.aspx"><IMG border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/98/03/98/AttachToProcess.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9980398/original.aspx" width=697 height=201 mce_src="http://blogs.msdn.com/photos/prabhatt/images/9980398/original.aspx"></A></FONT><FONT face=verdana,geneva>&nbsp;</FONT></LI>
<LI><FONT face=verdana,geneva>Select the process from the "Attach Profiler to Process" dialog box.</FONT><FONT face=verdana,geneva>&nbsp;<A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9980405.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9980405.aspx" target=_blank><IMG border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/98/04/05/ImageList.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9980405/original.aspx" width=769 height=402></A></FONT></LI></UL>
<P><FONT face=verdana,geneva>You can also select the CLR target version for the managed process.</FONT></P>
<UL>
<LI><FONT face=verdana,geneva>When you are done, detach it. </FONT></LI></UL>
<P><FONT face=verdana,geneva>[You can also use the /ATTACH:PID option with the vsperfcmd command]</FONT></P>
<H2><FONT size=2 face=verdana,geneva>Start Performance Analysis</FONT></H2>
<P><FONT face=verdana,geneva>With this new option, you can start profiling the application with minimal effort. Here are the steps to start a performance analysis session from the UI:</FONT></P>
<BLOCKQUOTE>
<P><FONT face=verdana,geneva>1. Open a solution in Visual Studio 2010.</FONT></P></BLOCKQUOTE>
<BLOCKQUOTE>
<P><FONT face=verdana,geneva>2. Click Debug&gt;Start Performance Analysis :</FONT></P></BLOCKQUOTE>
<BLOCKQUOTE>
<P><FONT face=verdana,geneva><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9980411.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9980411.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/prabhatt/picture9980411.aspx"><IMG border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/98/04/11/StartPerfAnalysis.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9980411/original.aspx" mce_src="http://blogs.msdn.com/photos/prabhatt/images/9980411/original.aspx"></A></FONT></P></BLOCKQUOTE>
<BLOCKQUOTE>
<P><FONT face=verdana,geneva>3. Select the Profiling method :</FONT></P></BLOCKQUOTE>
<BLOCKQUOTE>
<P><FONT face=verdana,geneva><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9980416.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9980416.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/prabhatt/picture9980416.aspx"><IMG border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/98/04/16/Wizard1.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9980416/original.aspx" mce_src="http://blogs.msdn.com/photos/prabhatt/images/9980416/original.aspx"></A></FONT></P></BLOCKQUOTE>
<BLOCKQUOTE>
<P><FONT face=verdana,geneva>4. Select the project and launch the profiler along with the application :</FONT></P>
<P><FONT face=verdana,geneva><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9980418.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9980418.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/prabhatt/picture9980418.aspx"><IMG border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/98/04/18/Wizard2.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9980418/original.aspx" mce_src="http://blogs.msdn.com/photos/prabhatt/images/9980418/original.aspx"></A></FONT></P></BLOCKQUOTE>
<BLOCKQUOTE>
<P><FONT face=verdana,geneva><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9980419.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9980419.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/prabhatt/picture9980419.aspx"><IMG border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/98/04/19/Wizard3.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9980419/original.aspx" mce_src="http://blogs.msdn.com/photos/prabhatt/images/9980419/original.aspx"></A><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9980418.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9980418.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/prabhatt/picture9980418.aspx"></A></FONT></P></BLOCKQUOTE>
<P mce_keep="true"><FONT face=verdana,geneva>Alternatively, you can also use the keyboard shortcut key ALT+F2 to run the profiler. This will invoke the performance wizard.</FONT></P>
<P mce_keep="true"><FONT face=Verdana><STRONG>Profiling in progress</STRONG></FONT></P>
<P mce_keep="true"><FONT face=Verdana>Profiling the application can take a long time and during this period a spin control is displayed.</FONT></P>
<P mce_keep="true"><FONT face=Verdana><IMG border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/98/04/09/Profiling.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9980409/498x183.aspx" mce_src="http://blogs.msdn.com/photos/prabhatt/images/9980409/498x183.aspx"></FONT></P>
<P mce_keep="true"><FONT face=Verdana>Here you get the option to stop profiling. This may be needed if the application has already reached at the stage which needs to be examined.</FONT></P>
<H2><FONT size=2 face=verdana,geneva>Profiler Summary Page</FONT></H2>
<P><FONT face=verdana,geneva>The report can be viewed in different forms. The default view is "Summary View".</FONT></P>
<BLOCKQUOTE>
<P><FONT face=verdana,geneva><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9980413.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9980413.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/prabhatt/picture9980413.aspx"><IMG border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/98/04/13/Views.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9980413/original.aspx" mce_src="http://blogs.msdn.com/photos/prabhatt/images/9980413/original.aspx"></A></FONT></P></BLOCKQUOTE>
<P><FONT face=verdana,geneva>The profiler summary page makes it easy to analyze the performance of the application. It contains the following important sections which helps diagnose the performance bottlenecks in the application. Profiling a simple VC# console application which contains a nested for-loop provides the following summary page:</FONT></P>
<BLOCKQUOTE>
<P><FONT face=verdana,geneva><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9980412.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9980412.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/prabhatt/picture9980412.aspx"><IMG style="WIDTH: 748px; HEIGHT: 443px" border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/98/04/12/Summary.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9980412/original.aspx" width=748 height=498 mce_src="http://blogs.msdn.com/photos/prabhatt/images/9980412/original.aspx"></A></FONT></P></BLOCKQUOTE>
<P><FONT face=verdana,geneva>The heading of the report lists how many samples were collected during the profiler session. In this example, there are 355 samples collected.</FONT></P>
<P><FONT face=verdana,geneva>Highlight a region in the graph and click the link "Filter by selection". </FONT></P>
<BLOCKQUOTE>
<P><FONT face=verdana,geneva><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9980403.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9980403.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/prabhatt/picture9980403.aspx"><IMG border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/98/04/03/GraphSelection.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9980403/original.aspx" width=810 height=235 mce_src="http://blogs.msdn.com/photos/prabhatt/images/9980403/original.aspx"></A></FONT></P></BLOCKQUOTE>
<P><FONT face=verdana,geneva>Right to the view selection box, there is a filter toolbar which contains different filtering options. Alternatively, filter criteria can be set by manually typing the timestamp values. </FONT></P>
<BLOCKQUOTE>
<P><FONT face=verdana,geneva><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9980401.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9980401.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/prabhatt/picture9980401.aspx"><IMG border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/98/04/01/FilterSelection.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9980401/original.aspx" mce_src="http://blogs.msdn.com/photos/prabhatt/images/9980401/original.aspx"></A></FONT></P></BLOCKQUOTE>
<P><FONT face=verdana,geneva>"Show Filter" is the first button which shows the filter criteria selection box. You can execute, import and export the reports also.</FONT></P>
<P><FONT face=verdana,geneva>Once the criteria are specified, use the "Execute Filter" (second button) to show the data based on the specified timeline.</FONT></P>
<P><FONT face=verdana,geneva>The filter can be reset by clicking the option in the Clear Report Filter in the Notifications section.</FONT></P>
<BLOCKQUOTE>
<P><FONT face=verdana,geneva><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9980408.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9980408.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/prabhatt/picture9980408.aspx"><IMG border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/98/04/08/Notifications.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9980408/original.aspx" width=230 height=131 mce_src="http://blogs.msdn.com/photos/prabhatt/images/9980408/original.aspx"></A></FONT></P></BLOCKQUOTE>
<H3><FONT size=2 face=verdana,geneva>Hot Path</FONT></H3>
<P><FONT face=verdana,geneva>The summary page also shows the call path that is most expensive. </FONT></P>
<BLOCKQUOTE>
<P><FONT face=verdana,geneva><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9980404.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9980404.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/prabhatt/picture9980404.aspx"><IMG border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/98/04/04/HotPath.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9980404/original.aspx" width=863 height=157 mce_src="http://blogs.msdn.com/photos/prabhatt/images/9980404/original.aspx"></A></FONT></P></BLOCKQUOTE>
<H3><FONT size=2 face=verdana,geneva>Functions doing most individual work</FONT></H3>
<P><FONT face=verdana,geneva>This section lists all the expensive functions in the order of their exclusive samples collected during the profiling.</FONT></P>
<BLOCKQUOTE>
<P><FONT face=verdana,geneva><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9980407.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9980407.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/prabhatt/picture9980407.aspx"><IMG border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/98/04/07/MostIndividualWork.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9980407/original.aspx" width=820 height=121 mce_src="http://blogs.msdn.com/photos/prabhatt/images/9980407/original.aspx"></A></FONT></P></BLOCKQUOTE>
<H3><FONT size=2 face=verdana,geneva>Function Details</FONT></H3>
<P><FONT face=verdana,geneva>Clicking the function will direct to the respective Function Details. Following is the function detail window for WriteLine(string) function.</FONT></P>
<BLOCKQUOTE>
<P><FONT face=verdana,geneva><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9980402.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9980402.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/prabhatt/picture9980402.aspx"><IMG style="WIDTH: 807px; HEIGHT: 314px" border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/98/04/02/FunctionDetails.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9980402/original.aspx" width=843 height=355 mce_src="http://blogs.msdn.com/photos/prabhatt/images/9980402/original.aspx"></A></FONT></P></BLOCKQUOTE>
<P><FONT face=verdana,geneva>The blue-boxes are click-able. Clicking the function will open-up the function code view:</FONT></P>
<BLOCKQUOTE>
<P><FONT face=verdana,geneva><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9980399.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9980399.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/prabhatt/picture9980399.aspx"><IMG border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/98/03/99/CodeView.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9980399/original.aspx" mce_src="http://blogs.msdn.com/photos/prabhatt/images/9980399/original.aspx"></A></FONT></P></BLOCKQUOTE>
<H2><FONT size=2 face=verdana,geneva>Profile Guidance Rule</FONT></H2>
<P><FONT face=verdana,geneva>Profile-guidance rules help to provide guidance to improve performance of the application.&nbsp; Go to Tools&gt;Options&gt;Performance Tools&gt;Rules. These rules can be configured depending on the need. </FONT></P>
<BLOCKQUOTE>
<P><FONT face=verdana,geneva><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9980410.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9980410.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/prabhatt/picture9980410.aspx"><IMG style="WIDTH: 752px; HEIGHT: 397px" border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/98/04/10/Rules.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9980410/original.aspx" width=809 height=458 mce_src="http://blogs.msdn.com/photos/prabhatt/images/9980410/original.aspx"></A></FONT></P></BLOCKQUOTE>
<P><FONT face=verdana,geneva>In the example, clicking the View Guidance under the Notifications section shows the following warning:</FONT></P>
<BLOCKQUOTE>
<P><FONT face=verdana,geneva><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9980454.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9980454.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/prabhatt/picture9980454.aspx"><IMG border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/98/04/54/RuleErrors.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9980454/original.aspx" width=811 height=52 mce_src="http://blogs.msdn.com/photos/prabhatt/images/9980454/original.aspx"></A></FONT></P></BLOCKQUOTE>
<H2><FONT size=2 face=verdana,geneva>Summary</FONT></H2>
<P><FONT face=verdana,geneva>It is worth investing time running Visual Studio 2010 Profiler to ensure high productivity and improved performance.<A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9980407.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9980407.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/prabhatt/picture9980407.aspx"></A></FONT></P>]]></content:encoded>
    </item>
    <item>
      <title>Intellitrace</title>
      <link>https://docs.microsoft.com/archive/blogs/yash/intellitrace</link>
      <pubDate>Sun, 14 Mar 2010 00:24:00 GMT</pubDate>
      <dc:creator><![CDATA[Prabhatyash]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/yash/2010/03/14/intellitrace/</guid>
      <description><![CDATA[1. Introduction 
2. How it works :

a. Events and Call Information 

b. Recordings - iTrace...]]></description>
      <content:encoded><![CDATA[1. Introduction 
<P>2. How it works :</P>
<BLOCKQUOTE>
<P>a. Events and Call Information </P></BLOCKQUOTE>
<BLOCKQUOTE>
<P>b. Recordings - iTrace file</P></BLOCKQUOTE>
<BLOCKQUOTE>
<P>c. Capturing Events<A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9977500.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9977500.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/prabhatt/picture9977500.aspx"></A></P></BLOCKQUOTE>
<BLOCKQUOTE>
<P>d. Specify modules </P></BLOCKQUOTE>
<BLOCKQUOTE>
<P>e. Intellitrace Window</P></BLOCKQUOTE>
<BLOCKQUOTE>
<P>f. Navigation Bar</P></BLOCKQUOTE>
<BLOCKQUOTE>
<P>g. Running the trace file</P></BLOCKQUOTE>
<P>3. Tips</P>
<P>4. Summary</P>
<P mce_keep="true">&nbsp;</P>
<P mce_keep="true">1. <B>Introduction</B></P>
<P mce_keep="true">Most developers are familiar with<B> </B>Visual Studio debugger. Up to Visual Studio 2008, you have an option to have a snapshot of the process. Those versions didn't give you the ability to go back and check other events and methods which might be responsible for the current state of the application. If you miss a single step, you need to restart debugging. Breakpoints/traces&nbsp; monitor the state of application but at times, it becomes very difficult to capture all information within the debugger.</P>
<P>The problem becomes more serious and time-consuming if you need to share your findings with others. What happens if the problem can't be reproduced on your colleague's machine? </P>
<P>In Visual Studio 2010 Ultimate Edition, there is a new feature called Intellitrace (also known as Historical Debugging). </P>
<P><B>Historical Debugging or Intellitrace</B></P>
<P>With Intellitrace, you can record the debug session and also save the application state for future reference. It enhances your live debugging experience. You can go back while debugging to check the events/local variables &amp; call-stack.</P>
<P><B>2. </B><B>How it works</B></P>
<P><B>a. </B><B>Events and Call Information</B></P>
<P mce_keep="true">Here is the options window:</P>
<P><B></B><B></B></P>
<P mce_keep="true"><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9978250.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9978250.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/prabhatt/picture9978250.aspx"></A>&nbsp;<A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9977495.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9977495.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/prabhatt/picture9977495.aspx"><IMG border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/97/74/95/Options.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9977495/original.aspx" mce_src="http://blogs.msdn.com/photos/prabhatt/images/9977495/original.aspx"></A></P>
<P mce_keep="true">You can get this Window by selecting Tools&gt;Options. By default, Intellitrace is enabled.</P>
<P mce_keep="true">If enabled, you can either set it to the default "Events only" level or set it to "Events and call information".</P>
<P mce_keep="true"><B>b.&nbsp;</B><B>Recordings - iTrace file</B></P>
<P mce_keep="true">Visual Studio saves a file called tracelog (.iTrace) for each debugging session. The name of the log file is unique and contains the date-timestamp for future reference. You can specify the location of the tracelog file and also control the maximum size of the file.</P>
<P mce_keep="true"><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9977500.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9977500.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/prabhatt/picture9977500.aspx"><IMG border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/97/75/00/TDLOG.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9977500/original.aspx" mce_src="http://blogs.msdn.com/photos/prabhatt/images/9977500/original.aspx"></A></P>
<P>The&nbsp;iTrace filenames are self explanatory. For example the following file is saved on my machine:</P>
<P mce_keep="true"><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9977503.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9977503.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/prabhatt/picture9977503.aspx"></A></P>
<P>I tried two debugging sessions on a simple WinForms application and thus there are two iTrace files generated.</P>
<P mce_keep="true">Typical file format is:</P>
<P>&lt;application_name&gt; _&lt;YYMMDD_HHMMSS&gt;.iTrace</P>
<P mce_keep="true">[As you can see the application name is followed by the vshost here. You may need to disable vshost to get the iTrace for the application not running under vshost. Visual Studio hosting process can be disabled by unchecking Project&gt;Project_name Properties&gt;Debug&gt;Enable Debuggers&gt;Enable Visual Studio Hosting Process.]</P>
<P mce_keep="true"><B>c.&nbsp;</B><B>Capturing Events</B></P>
<P>You can capture following categories of events:</P>
<BLOCKQUOTE>
<P mce_keep="true">i. ADO.Net</P></BLOCKQUOTE>
<BLOCKQUOTE>
<P>ii. ASP.Net</P></BLOCKQUOTE>
<BLOCKQUOTE>
<P>iii. Console</P></BLOCKQUOTE>
<BLOCKQUOTE>
<P>iv. Data Binding</P></BLOCKQUOTE>
<BLOCKQUOTE>
<P>v. Environment Variable</P></BLOCKQUOTE>
<BLOCKQUOTE>
<P>vi. File</P></BLOCKQUOTE>
<BLOCKQUOTE>
<P>vii. Gesture</P></BLOCKQUOTE>
<BLOCKQUOTE>
<P>viii. Lazy Initialization</P></BLOCKQUOTE>
<BLOCKQUOTE>
<P>ix. Registry</P></BLOCKQUOTE>
<BLOCKQUOTE>
<P>x. Service Model</P></BLOCKQUOTE>
<BLOCKQUOTE>
<P>xi. Threading</P></BLOCKQUOTE>
<BLOCKQUOTE>
<P>xii. Tracing</P></BLOCKQUOTE>
<BLOCKQUOTE>
<P>xiii. User Prompt</P></BLOCKQUOTE>
<BLOCKQUOTE>
<P>xiv. WorkFlow</P></BLOCKQUOTE>
<BLOCKQUOTE>
<P>xv. XML</P></BLOCKQUOTE>
<P mce_keep="true">You can select them by menu <B>Tools&gt;Options&gt;Intellitrace&gt;Intellitrace Events</B>. Under each category, there is a list of events that can be opted individually.</P>
<P mce_keep="true"><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9978250.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9978250.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/prabhatt/picture9978250.aspx"></A></P>
<P mce_keep="true"><B><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9978444.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9978444.aspx" target=_blank><IMG border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/97/84/44/Events2.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9978444/original.aspx"></A>&nbsp;</B></P>
<P mce_keep="true"><B>d.&nbsp;&nbsp;&nbsp; </B><B>Specify Modules</B></P>
<P mce_keep="true">You can also specify the modules for which you need to record events, methods &amp; parameters. <B></B></P>
<P><B></B><B></B></P>
<P><B><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9978238.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9978238.aspx" target=_blank><IMG border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/97/82/38/Modules.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9978238/original.aspx"></A></B></P>
<P>Either you can make an exclusion list or, an inclusion list whichever is smaller. This gives a lot of flexibility in instrumentation. For example, if you don't want to capture details about the module presentationcore.dll, you can include in the exclusion list so that its methods and their parameter details are not captured. This helps in reducing the size of the tracelog file and also filters useful information needed for debugging.</P>
<P mce_keep="true"><B>e.&nbsp;&nbsp;&nbsp; </B><B>Intellitrace Window </B></P>
<P>For this example, IntelliTrace is enabled. Create a simple Winforms application and start debugging. You will find that a new window appears called "Intellitrace". [If not visible, you may need to click the Intellitrace TAB in the pane.]</P>
<P>Familiarity with the Intellitrace Window:<A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9978245.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9978245.aspx" target=_blank><IMG border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/97/82/45/Views.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9978245/original.aspx"></A></P>
<P>There are two Views:</P>
<P>I. Events View - In this view, captured events are shown. You can filter the categories of events from the drop down combo-box on the left side displayed in the figure as "All Categories". Similarly, you can concentrate on some specific threads as well (selected by the next combo-box shown as "All Threads".</P>
<P>II. Methods View - displays only when method logging is enabled(i.e. when "Events and call information" is selected.</P>
<P mce_keep="true">This Intellitrace window shows us the default events that are captured. For example, two events are shown below:</P>
<P mce_keep="true"><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9978234.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9978234.aspx" target=_blank><IMG border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/97/82/34/LiveEvent.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9978234/original.aspx"></A></P>
<P mce_keep="true">I am currently at a breakpoint which is showing as the yellow arrow button. If the first button is clicked, the debugger reaches the main function and the side bar (navigation bar) shows an arrow sign with a clock:</P>
<P mce_keep="true">&nbsp;<A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9978239.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9978239.aspx" target=_blank><IMG border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/97/82/39/NavBar1.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9978239/original.aspx"></A></P>
<P mce_keep="true">You can see the Call Stack, locals and exceptions by clicking the options available with each captured event in Intellitrace window.</P>
<P mce_keep="true"><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9978236.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9978236.aspx" target=_blank><IMG border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/97/82/36/LocalsCallStack.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9978236/original.aspx"></A></P>
<P mce_keep="true"><B>f.&nbsp;&nbsp;&nbsp;&nbsp; </B><B>Navigation Bar </B></P>
<P>When the exception is selected in the Intellitrace view, Navigation Bar becomes visible.</P>
<P mce_keep="true"><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9978240.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9978240.aspx" target=_blank><IMG border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/97/82/40/NavBar2.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9978240/original.aspx"></A></P>
<P mce_keep="true">If you click <B>Set Debugger Context </B>button, the debugger will set the context to the current event.<B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </B></P>
<P><B></B><B></B></P>
<P mce_keep="true"><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9978241.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9978241.aspx" target=_blank><IMG border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/97/82/41/NavBar3.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9978241/original.aspx"></A></P>
<P>As you can see, there are <B>step out</B>, <B>go to previous call</B>, <B>step in</B>, <B>go to next call</B>, and <B>go to live mode</B> buttons available.</P>
<P><B>g.&nbsp;&nbsp;&nbsp; </B><B>Running the trace file </B></P>
<P>Now suppose you are given a project with the trace log to reproduce a bug. How do you run the file and reproduce the issue?</P>
<P>i. Open the tracelog file in Visual Studio. [Use the menu option File&gt;Open and select the&nbsp;iTrace file.]</P>
<P>ii. In Visual Studio , You will see Intellitrace summary page like this :</P>
<P mce_keep="true"><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9978243.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9978243.aspx" target=_blank><IMG border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/97/82/43/Summary1.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9978243/original.aspx"></A></P>
<P>This graph contains the timestamp of the entire debug session along with the thread lists. If you expand, you will find all the threads listed:</P>
<P mce_keep="true"><A href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com//prabhatt/9978244.aspx" original-url="http://blogs.msdn.com/photos/prabhatt/picture9978244.aspx" target=_blank><IMG border=0 src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/97/82/44/ThreadList.jpg" original-url="http://blogs.msdn.com/photos/prabhatt/images/9978244/original.aspx"></A></P>
<P>If you double-click any thread, the debugging session will start for that thread. You need to match the symbols and align the source to get the full advantage.</P>
<P><B>3. Tips</B></P>
<P>a. Navigation gutter not shown </P>
<P>The navigation bar or gutter is visible if you select the check box "<B>Tools &gt;Options&gt;Intellitrace&gt;Advanced&gt;Display the navigation gutter"</B> while in debug mode.</P>
<P mce_keep="true">b. No source available </P>
<P mce_keep="true">You need to make sure that the source code for the modules is available. If not, you will get the following error:</P>
<P mce_keep="true">c. Intellitrace does not support Remote Debugging</P>
<P mce_keep="true">So what happens if you attach the debugger to a remote process? You will not get Intellitrace support.</P>
<P mce_keep="true">d. Intellitrace does not support debugging C++ Unmanaged/Mixed-Mode code</P>
<P mce_keep="true">Currently, Intellitrace doesn't have the functionality to get a trace log for unmanaged code.</P>
<P><B>4. Summary </B></P>
<P>In short, Intellitrace will drastically change the debugging experience and help reduce the time reproducing bugs in our application. Let's start using it and enjoy. </P>
<P mce_keep="true">&nbsp;</P>
<P align=center>!!!Happy Debugging!!!</P>
<P mce_keep="true">&nbsp;</P>
<P mce_keep="true">&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>Launching a debugger from an application</title>
      <link>https://docs.microsoft.com/archive/blogs/yash/launching-a-debugger-from-an-application</link>
      <pubDate>Thu, 16 Apr 2009 20:25:00 GMT</pubDate>
      <dc:creator><![CDATA[Prabhatyash]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/yash/2009/04/16/launching-a-debugger-from-an-application/</guid>
      <description><![CDATA[You have a managed application. Let’s suppose a Winforms application in VC#. You want your...]]></description>
      <content:encoded><![CDATA[<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>You have a managed application. Let’s suppose a Winforms application in VC#. You want your application to launch the debugger automatically. For this purpose, you added in your program the line System.Diagnostics.Debugger.Launch().</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>When we run the application outside the debugger, it runs fine, launches the debugger and works normally.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="mso-no-proof: yes"><?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /><v:shapetype id=_x0000_t75 stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"></v:path><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:lock aspectratio="t" v:ext="edit"></o:lock></v:shapetype></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>&nbsp;</FONT><FONT face=Calibri size=3>Now what happens when we run the application inside the debugger?&nbsp;Per MSDN documentation, nothing should happen when this line is executed.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; tab-stops: center 3.25in"><A href="http://msdn.microsoft.com/en-us/library/system.diagnostics.debugger.launch.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.diagnostics.debugger.launch.aspx"><FONT face=Calibri color=#0000ff size=3>System.Diagnostics.Debugger.Launch()</FONT></A><SPAN style="mso-tab-count: 1"><FONT face=Calibri size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; tab-stops: center 3.25in"><FONT face=Calibri size=3>This seems to be quite logical. When a process is already attached with the debugger, how can you attach another one? Similar is the case with the remote debugging. </FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>Now the question may arise, which one gets precedence? Whoever arrives first. Alright now how can we know what is happening in background? Interestingly, if try to attach a debugger to a process which has already invoked a debugger through Debugger.Launch() then we would get the message :</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>"Unable to attach to the process. A debugger is already attached."</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="mso-no-proof: yes"></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT size=3><FONT face=Calibri><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>On the other way, if a debugger is already running a process and encounters Debugger.Launch(), it will silently ignore it.</FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><o:p><FONT face=Calibri size=3>&nbsp;</FONT></o:p></P>
<P mce_keep="true">&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>Using Procmon in Command-line</title>
      <link>https://docs.microsoft.com/archive/blogs/yash/using-procmon-in-command-line</link>
      <pubDate>Mon, 23 Mar 2009 16:15:00 GMT</pubDate>
      <dc:creator><![CDATA[Prabhatyash]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/yash/2009/03/23/using-procmon-in-command-line/</guid>
      <description><![CDATA[You can run Procmon using command-line.
1.&nbsp;The following command-line will spawn procmon in...]]></description>
      <content:encoded><![CDATA[<P>You can run Procmon using command-line.</P>
<P>1.&nbsp;The following command-line will spawn procmon in Quiet mode(will not ask for any filter. It will collect all information). The procmon will start in the minimized window and also save the log in the file(abc.PML):<BR>procmon /Quiet /Minimized /BackingFile abc.PML<BR>2.&nbsp;Once you are done you can issue the following command to stop the procmon :<BR>procmon /Terminate<BR>3.&nbsp;Now you can open the abc.PML file and check if there is any activity that is causing the issue.</P>
<P>You can even schedule two tasks to start/stop procmon at the specified time.</P>]]></content:encoded>
    </item>
    <item>
      <title>Unable to StepInto the code while debugging?</title>
      <link>https://docs.microsoft.com/archive/blogs/yash/unable-to-stepinto-the-code-while-debugging</link>
      <pubDate>Mon, 25 Feb 2008 08:37:00 GMT</pubDate>
      <dc:creator><![CDATA[Prabhatyash]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/yash/2008/02/25/unable-to-stepinto-the-code-while-debugging/</guid>
      <description><![CDATA[In Visual Studio, System.Diagnostics.DebuggerStepThroughAttribute is added automatically by some of...]]></description>
      <content:encoded><![CDATA[<P>In Visual Studio, <A class="" href="http://msdn2.microsoft.com/en-us/library/system.diagnostics.debuggerstepthroughattribute.aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/library/system.diagnostics.debuggerstepthroughattribute.aspx">System.Diagnostics.DebuggerStepThroughAttribute</A> is added automatically by some of the code generators. You may face challenges while debugging the code because this attribute tells the debugger not to stop in the specifed method/class which is attached to it. </P>
<P><STRONG>Observation</STRONG><BR>If you are able to setup breakpoints in the code and hit them but are unable to step-Into or Step-Through then there are chances that this attribute is added in your code. </P>
<P><STRONG>How to get it worked</STRONG><BR>In most of the cases you can comment-out the lines of code for this attribute.</P>
<P mce_keep="true">&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>Remote Debugging</title>
      <link>https://docs.microsoft.com/archive/blogs/yash/remote-debugging</link>
      <pubDate>Thu, 20 Dec 2007 18:37:00 GMT</pubDate>
      <dc:creator><![CDATA[Prabhatyash]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/yash/2007/12/20/remote-debugging/</guid>
      <description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs...]]></description>
      <content:encoded><![CDATA[<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify; tab-stops: 148.9pt"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></B></P>
<P class=MsoNormalCxSpMiddle style="MARGIN: auto auto 0pt; TEXT-ALIGN: justify; mso-add-space: auto"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana">1.</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 7pt; LINE-HEIGHT: 115%; mso-fareast-font-family: Verdana"><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp; </FONT></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Arial">Introduction.</SPAN></B></P>
<P class=MsoNormalCxSpMiddle style="MARGIN: auto auto 0pt; TEXT-ALIGN: justify; mso-add-space: auto"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Arial"></SPAN></B><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Arial">Remote debugging is one of the most interesting features of Visual Studio and it has been greatly simplified in Visual Studio 2005. The purpose of this article is to discuss the basic functionality, configuration details, and troubleshooting steps required for a successful remote debugging session.<o:p></o:p></SPAN></P>
<P class=MsoNormalCxSpMiddle style="MARGIN: auto auto 0pt; TEXT-ALIGN: justify; mso-add-space: auto; mso-margin-top-alt: auto"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Arial">Why we need remote debugging?<o:p></o:p></SPAN></P>
<P class=MsoNormalCxSpMiddle style="MARGIN: auto auto 0pt; TEXT-ALIGN: justify; mso-add-space: auto; mso-margin-top-alt: auto"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Arial">Troubleshooting an application on development environment is not a preferred choice. Especially when we have deployed an application on a production server where Visual Studio is not installed. It becomes more difficult when there is something system specific. In such situations, Remote debugging is a solution.<o:p></o:p></SPAN></P>
<P class=MsoNormalCxSpMiddle style="MARGIN: auto auto 0pt; TEXT-ALIGN: justify; mso-add-space: auto"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Arial"><o:p></o:p></SPAN></P>
<P class=MsoNormalCxSpMiddle style="MARGIN: auto auto 0pt; TEXT-ALIGN: justify; mso-add-space: auto"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana">2.</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 7pt; LINE-HEIGHT: 115%; mso-fareast-font-family: Verdana"><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp; </FONT></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Arial">Remote Debugging components.<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"></SPAN>&nbsp;</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Before we start let’s try to understand what are the important components which play an important role in remote debugging.</SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Basically remote debugging works in a client-server architecture model. On the local machine there is devenv.exe (Visual Studio) and on the remote machine, the required component is msvsmon.exe( Visual studio remote debugging monitor).<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Besides them there are several other components as well. Here is an article which gives a detailed list of <A href="http://msdn2.microsoft.com/en-us/library/ey7ec813(VS.80).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ey7ec813(VS.80).aspx"><SPAN style="LINE-HEIGHT: 115%; mso-bidi-font-size: 11.0pt">Remote debugging components</SPAN></A>. Both managed and native debugging is supported.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">These components are installed on the machine where Visual Studio 2005 is installed. And can be safely copied or shared to the remote machine.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">These components are located at the following location: <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%; TEXT-ALIGN: justify"><I><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 140%; FONT-FAMILY: 'Verdana','sans-serif'">Install path</SPAN></I><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 140%; FONT-FAMILY: 'Verdana','sans-serif'"> </SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 140%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'">\Microsoft Visual Studio 8\Common7\IDE\Remote Debugger\x86</SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 140%; FONT-FAMILY: 'Verdana','sans-serif'"> <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%; TEXT-ALIGN: justify"><I><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 140%; FONT-FAMILY: 'Verdana','sans-serif'">Install path</SPAN></I><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 140%; FONT-FAMILY: 'Verdana','sans-serif'"> </SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 140%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'">\Microsoft Visual Studio 8\Common7\IDE\Remote Debugger\x64</SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 140%; FONT-FAMILY: 'Verdana','sans-serif'"> <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%; TEXT-ALIGN: justify"><I><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 140%; FONT-FAMILY: 'Verdana','sans-serif'">Install path</SPAN></I><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 140%; FONT-FAMILY: 'Verdana','sans-serif'"> </SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 140%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'">\Microsoft Visual Studio 8\Common7\IDE\Remote Debugger\ia64</SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 140%; FONT-FAMILY: 'Verdana','sans-serif'"> <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 140%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 140%; FONT-FAMILY: 'Verdana','sans-serif'">Sharing the components is the preferred choice.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 140%; FONT-FAMILY: 'Verdana','sans-serif'">For a successful communication between the local and remote machine, there are several ports under the hood that needs to be opened. If there is any firewall between the two systems then it needs to be configured.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 140%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormalCxSpMiddle style="MARGIN: auto auto 0pt; TEXT-ALIGN: justify; mso-add-space: auto"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana">3.</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 7pt; LINE-HEIGHT: 115%; mso-fareast-font-family: Verdana"><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp; </FONT></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Arial">DCOM configuration</SPAN></B><SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Times New Roman','serif'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Arial"></SPAN>&nbsp;</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Arial">Remote access permissions for anonymous logon need to be setup on the machine where Visual Studio is installed. This can be done by using <A href="http://support.microsoft.com/kb/833977" mce_href="http://support.microsoft.com/kb/833977"><SPAN style="LINE-HEIGHT: 115%; mso-bidi-font-size: 11.0pt">DCOM configuration tool</SPAN></A> (dcomcnfg.exe )<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 140%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormalCxSpMiddle style="MARGIN: auto auto 0pt; TEXT-ALIGN: justify; mso-add-space: auto"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana">4.</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 7pt; LINE-HEIGHT: 115%; mso-fareast-font-family: Verdana"><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp; </FONT></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Arial">Firewall Settings and security (Ports and permissions)<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"></SPAN>&nbsp;</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">DCOM RPC uses TCP 135 and IPSec uses UDP 500 and UDP 4500. These ports must be opened on both the machines.</SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Moreover permissions needs to be set for file and print sharing and adding msvsmon(on remote machine) and devenv.exe(on the local machine) to the exception list in the firewall settings.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN><A href="http://support.microsoft.com/kb/833977" mce_href="http://support.microsoft.com/kb/833977"><SPAN style="LINE-HEIGHT: 115%; mso-bidi-font-size: 11.0pt">Here</SPAN></A> is an article which explains the steps. <o:p></o:p></SPAN></P>
<P class=MsoNormalCxSpMiddle style="MARGIN: auto auto 0pt; TEXT-ALIGN: justify; mso-add-space: auto"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Arial"><o:p></o:p></SPAN></P>
<P class=MsoNormalCxSpMiddle style="MARGIN: auto auto 0pt; TEXT-ALIGN: justify; mso-add-space: auto"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana">5.</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 7pt; LINE-HEIGHT: 115%; mso-fareast-font-family: Verdana"><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp; </FONT></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Arial">Workgroup or Domain - how machines are connected?</SPAN></B><SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Times New Roman','serif'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Arial">There are different network scenarios. Depending upon which we needs to check the network authentication and communication issues. <A href="http://msdn2.microsoft.com/en-us/library/9y5b4b4f(VS.80).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/9y5b4b4f(VS.80).aspx"><SPAN style="LINE-HEIGHT: 115%; mso-bidi-font-size: 11.0pt">Remote Debugging Across Domains</SPAN></A> .<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormalCxSpMiddle style="MARGIN: auto auto 0pt; TEXT-ALIGN: justify; mso-add-space: auto"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana">6.</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 7pt; LINE-HEIGHT: 115%; mso-fareast-font-family: Verdana"><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp; </FONT></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Arial">Managed or Unmanaged code (Is debugging mixed code possible) <o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"></SPAN>&nbsp;</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Remote debugging is supported for both the managed and unmanaged code. However mixed code debugging or debugging managed and unmanaged code at the same time may not be stable. It is advisable to disable it <A href="http://msdn2.microsoft.com/en-us/library/tdw0c6sf(VS.80).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/tdw0c6sf(VS.80).aspx"><SPAN style="LINE-HEIGHT: 115%; mso-bidi-font-size: 11.0pt">How to: Enable Debugging of Unmanaged Code</SPAN></A>.</SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormalCxSpMiddle style="MARGIN: auto auto 0pt; TEXT-ALIGN: justify; mso-add-space: auto"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana">7.</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 7pt; LINE-HEIGHT: 115%; mso-fareast-font-family: Verdana"><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp; </FONT></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Arial">User Rights </SPAN></B></P>
<P class=MsoNormalCxSpMiddle style="MARGIN: auto auto 0pt; TEXT-ALIGN: justify; mso-add-space: auto"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">In order to have a successful communication, the user account on the local machine must map to the user account on the remote machine and vice-versa. The safest way is to check that both the users are the members of the administrator/Debugger group and have the same username and password. However, this is not compulsory.</SPAN><SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Times New Roman','serif'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"><A class="" title=lsm_add_users_to_groups name=lsm_add_users_to_groups></A><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormalCxSpMiddle style="MARGIN: auto auto 0pt; TEXT-ALIGN: justify; mso-add-space: auto"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana">8.</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 7pt; LINE-HEIGHT: 115%; mso-fareast-font-family: Verdana"><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp; </FONT></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Arial">Authentication mode and No authentication – A threat to security?<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"></SPAN>&nbsp;</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Remote debugging in Visual Studio 2005 is supported in both the Authentication mode and no-Authentication mode. However no-authentication mode supports only the native code debugging.</SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">No-authentication mode is faster but unsecured.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><A href="http://msdn2.microsoft.com/en-us/library/ms164722(VS.80).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms164722(VS.80).aspx"><SPAN style="LINE-HEIGHT: 115%; mso-bidi-font-size: 11.0pt">How to: Set Up Windows Authentication Mode<SPAN style="mso-spacerun: yes">&nbsp; </SPAN></SPAN></A><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><A href="http://msdn2.microsoft.com/en-us/library/ms164723(VS.80).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms164723(VS.80).aspx"><SPAN style="LINE-HEIGHT: 115%; mso-bidi-font-size: 11.0pt">How to: Set Up "No Authentication" Mode<SPAN style="mso-spacerun: yes">&nbsp; </SPAN></SPAN></A><SPAN style="mso-spacerun: yes">&nbsp;</SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormalCxSpMiddle style="MARGIN: auto auto 0pt; TEXT-ALIGN: justify; mso-add-space: auto"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana">9.</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 7pt; LINE-HEIGHT: 115%; mso-fareast-font-family: Verdana"><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp; </FONT></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Arial">Two remote Debugging scenarios<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"></SPAN>&nbsp;</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Remote debugging can be performed in two ways:</SPAN><SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Times New Roman','serif'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana">a.</SPAN><SPAN style="FONT-SIZE: 7pt; LINE-HEIGHT: 115%; mso-fareast-font-family: Verdana"><FONT face=Calibri>&nbsp;&nbsp;&nbsp;&nbsp; </FONT></SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">To start a process from local machine, see <A href="http://msdn2.microsoft.com/en-us/library/8x6by8d2.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/8x6by8d2.aspx"><SPAN style="LINE-HEIGHT: 115%; mso-bidi-font-size: 11.0pt">Remote Debugging of a Project Built Locally</SPAN></A></SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana">&nbsp;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana">b.</SPAN><SPAN style="FONT-SIZE: 7pt; LINE-HEIGHT: 115%; mso-fareast-font-family: Verdana"><FONT face=Calibri>&nbsp;&nbsp;&nbsp; </FONT></SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">To attach to a process already running on remote machine, see <A href="http://msdn2.microsoft.com/en-us/library/8x6by8d2.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/8x6by8d2.aspx"><SPAN style="LINE-HEIGHT: 115%; mso-bidi-font-size: 11.0pt">How to: Select a Remote Machine</SPAN></A></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p><FONT face=Calibri size=3>&nbsp;</FONT></o:p></P>
<P mce_keep="true">&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>PDB Files - What are they and how to generate them.</title>
      <link>https://docs.microsoft.com/archive/blogs/yash/pdb-files-what-are-they-and-how-to-generate-them</link>
      <pubDate>Fri, 12 Oct 2007 18:54:00 GMT</pubDate>
      <dc:creator><![CDATA[Prabhatyash]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/yash/2007/10/12/pdb-files-what-are-they-and-how-to-generate-them/</guid>
      <description><![CDATA[How to generate PDB files for RELEASE build
====================================
We can genererate...]]></description>
      <content:encoded><![CDATA[<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><FONT face=Calibri size=3>How to generate PDB files for RELEASE build</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><FONT face=Calibri size=3>====================================</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><FONT face=Calibri size=3>We can genererate PDB(Program Data Base) files for RELEASE build also.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><FONT face=Calibri size=3>Set “Project-&gt;Project Properties-&gt;Configuration Properties-&gt;Linker-&gt;Debugging-&gt;Generate Debug Info” to “Yes”.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; tab-stops: 81.8pt"><FONT face=Calibri size=3>Once you select this option, the next option “Generate Program Database File” will show the default path and name for the PDB file. If you build your solution it will generate &lt;Targetname&gt;.PDB file. This file will contain the debug info for the binary.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; tab-stops: 81.8pt"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p><FONT face=Calibri size=3>&nbsp;</FONT></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; tab-stops: 81.8pt"><FONT face=Calibri size=3>For generating the PDB in C#</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; tab-stops: 81.8pt"><FONT face=Calibri size=3>=======================</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; tab-stops: 81.8pt"><FONT face=Calibri size=3>Set “Project Properties -&gt; Build -&gt; Advanced…-&gt;Output -&gt; Debug Info” to “PDB-only” or “Full”.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; tab-stops: 81.8pt"><o:p><FONT face=Calibri size=3>&nbsp;</FONT></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; tab-stops: 81.8pt"><FONT face=Calibri size=3>What are the two types of .PDB files?</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; tab-stops: 81.8pt"><FONT face=Calibri size=3>==============================</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; tab-stops: 81.8pt"><FONT face=Calibri size=3>There are two types of PDB files. One generated by the compiler named as VCx0.PDB(e.g. vc80.pdb), and another the &lt;Targetname&gt;.PDB. </FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; tab-stops: 81.8pt"><o:p><FONT face=Calibri size=3>&nbsp;</FONT></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; tab-stops: 81.8pt"><FONT face=Calibri size=3>The VCx0.PDB file is generated by the compiler and it is related to the .OBJ file. It contains the type information only.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; tab-stops: 81.8pt"><o:p><FONT face=Calibri size=3>&nbsp;</FONT></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; tab-stops: 81.8pt"><FONT face=Calibri size=3>The &lt;Targetname&gt;.PDB files are generated by the linker and it is related with the target executable or the DLL. This file contains the complete debug info. When we are debugging, we need this ‘.pdb’ file for aligning to the symbols. The timestamp of the target file and the PDB should match.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; tab-stops: 81.8pt"><o:p><FONT face=Calibri size=3>&nbsp;</FONT></o:p></P>]]></content:encoded>
    </item>
    <item>
      <title>Debugger not working</title>
      <link>https://docs.microsoft.com/archive/blogs/yash/debugger-not-working</link>
      <pubDate>Thu, 20 Sep 2007 15:14:00 GMT</pubDate>
      <dc:creator><![CDATA[Prabhatyash]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/yash/2007/09/20/debugger-not-working/</guid>
      <description><![CDATA[&nbsp;
Problem Description================
When you try to debug a simple windows application in...]]></description>
      <content:encoded><![CDATA[<P><STRONG></STRONG>&nbsp;</P>
<P><STRONG>Problem Description<BR>================</STRONG></P>
<P>When you try to debug a simple windows application in Visual Studio 2005, you get the following error :</P>
<P><BR>----------------------------------<BR>Microsoft Visual Studio<BR>----------------------------------<BR>Unable to start program '&lt;application_name&gt;'.A debugger dll, msdbg2.dll, is not correctly installed. Please repair your Visual Studio installation via 'Add or Remove Programs' in control panel.</P>
<P>If the problem persists, you can manually register msdbg2.dll from the command prompt with 'regsvr32 "%CommonProgramFiles%\Microsoft Shared\VS7Debug\msdbg.dll"'.<BR>----------------------------------<BR>OK&nbsp;&nbsp; <BR>----------------------------------</P>
<P mce_keep="true">&nbsp;</P>
<P mce_keep="true"><STRONG>Diagnostic<BR>=======</STRONG></P>
<P>We can use Debugger Diagnostic Tool to find out any error about this :</P>
<P>This Tool is available <A class="" title=here. href="http://download.microsoft.com/download/a/6/f/a6f1de85-7284-4c97-9ddd-6f18000f5848/DebuggerDiagnostics.msi" mce_href="http://download.microsoft.com/download/a/6/f/a6f1de85-7284-4c97-9ddd-6f18000f5848/DebuggerDiagnostics.msi">here</A>.</P>
<P>In order to simulate the problem, i tried to rename the msdbg2.dll file on my system and then run the DebuggerDiagnostic tool. The output that i get on my system is the following :</P>
<P><BR>C:\Documents and Settings\prabhatt\My Documents\MSDN\Debugger Diagnostics&gt;DebuggerDiagnostics.exe</P>
<P>Begin 'CheckMDMImage()'<BR>mdm.exe: version '7.10.3077' with hash '{6607858A-7B579EC3-E062DAB3-BF891368-CBF1CB9C}'.<BR>Result of 'CheckMDMImage()' is '00000000'</P>
<P>Begin 'CheckMSDBG2Image()'<BR>Could not calculate hash for 'msdbg2.dll' - 0x80070002<BR>Result of 'CheckMSDBG2Image()' is '80070002'</P>
<P>...</P>
<P>Begin 'CoCreateMachineDebugManager(&amp;spMachine)'<BR>Result of 'CoCreateMachineDebugManager(&amp;spMachine)' is '8007007e'</P>
<P mce_keep="true">&nbsp;</P>
<P><STRONG>Analysing the report<BR></STRONG>===============</P>
<P>We found that the following portion is reporting some error :</P>
<P><STRONG>Begin 'CheckMSDBG2Image()'<BR>Could not calculate hash for 'msdbg2.dll' - 0x80070002<BR>Result of 'CheckMSDBG2Image()' is '80070002'</STRONG></P>
<P>It states that it is unable to calculate the HASH value of the msdbg2.dll. Which indicates that there might be some problem with this DLL.</P>
<P mce_keep="true">&nbsp;</P>
<P><STRONG>Root Cause<BR>=======</STRONG></P>
<P>There are three causes of this issue :-<BR>1. The dll is not present physically at the specified path.<BR>2. The dll is corrupted due to some unknown reason.<BR>3. The dll is not the original one that comes with Visual Studio.</P>
<P mce_keep="true"><STRONG></STRONG>&nbsp;</P>
<P mce_keep="true"><STRONG>Conflict/Corrupt or missing msdbg2.dll<BR>=======================</STRONG></P>
<P>Once we identify that there are some issues with this dll, lets start identifying what might be the reason.</P>
<P>1. Manually search for the file in the directory C:\Program Files\Common Files\Microsoft Shared\VS7Debug</P>
<P>Is the file present there? If no we need to install the file there and register it properly.</P>
<P>There are several public sites from where we can download, install and register it. Since these sites might not be safe. I would recommend you to try installing the files from the installation disks of Visual Studio that you have.</P>
<P>2. If the file is physically present there, then it might be corrupted. So go ahead and install the new file from the installation disk and register it.</P>
<P>3. One interesting thing is that Office XP installation and Office XP update KB833858 also contain the same file msdbg2.dll. So if by any chance, if this file is installed by accident to the directory(C:\Program Files\Common Files\Microsoft Shared\VS7Debug) then also we may get this issue. We can verify this by checking the version, the file that comes with Visual Studio 2005&nbsp;has the version 8.0.50727.42. On the other hand the file that comes with Office XP update (KB833858) has the version 7.0.9466.0. If this is the case unregister the dll. Install the original one and register it.</P>
<P><STRONG></STRONG>&nbsp;</P>
<P><STRONG>How to Unregister a dll<BR>==============</STRONG></P>
<P>1. Start-&gt;Run-&gt;cmd.<BR>2. At a command prompt, type the following command: <BR>regsvr32 /u &lt;path_of_msdbg2.dll&gt;\msdbg2.dll&nbsp; </P>
<P><STRONG></STRONG>&nbsp;</P>
<P><STRONG>How to Register a dll<BR>=============</STRONG></P>
<P>1. Start-&gt;Run-&gt;cmd.<BR>2. At a command prompt, type the following command: <BR>regsvr32 &lt;path_of_msdbg2.dll&gt;\msdbg2.dll&nbsp; <BR></P>]]></content:encoded>
    </item>
    <item>
      <title>Intellisense issues in Visual C++ 2005</title>
      <link>https://docs.microsoft.com/archive/blogs/yash/intellisense-issues-in-visual-c-2005</link>
      <pubDate>Wed, 19 Sep 2007 10:25:00 GMT</pubDate>
      <dc:creator><![CDATA[Prabhatyash]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/yash/2007/09/19/intellisense-issues-in-visual-c-2005/</guid>
      <description><![CDATA[When we are working with Visual Studio IDE, sometimes we encounter issues related to intellisense....]]></description>
      <content:encoded><![CDATA[<P>When we are working with Visual Studio IDE, sometimes we encounter issues related to intellisense. The main objective of this article is to provide some basic troubleshooting steps to overcome some of the issues. <BR></P>
<P>Lets first start with a basic understanding of <A class="" title="IntelliSense Support in Visual C++" href="http://msdn2.microsoft.com/en-us/library/ms379615(vs.80).aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/library/ms379615(vs.80).aspx "><STRONG>IntelliSense Support in Visual C++<BR></STRONG></A></P>
<P><STRONG>What is the issue?</STRONG></P>
<P>1.&nbsp;Intellisense doesn’t work at all.<BR>2.&nbsp;Intellisense is very slow(Giving Updating Intellisense… in status bar)<BR>3.&nbsp;Intellisense fails causing Visual Studio to exit or Hang forever.<BR>4.&nbsp;Intellisense doesn’t work for a part of the solution.</P>
<P><BR>1.&nbsp;<STRONG>Verifying Intellisense issue (or Disabling Intellisense)</STRONG></P>
<P>There are chances that we are misinterpreting some issues with Intellisense. We can verify this by disabling Intellisense in VC++. There is a file called feacp.dll in &lt;VS8INSTALL&gt;\VC\vcpackages folder. Renaming this file will disable Intellisense feature.</P>
<P>After disabling, if we can work with the IDE without any other issue then we can say for sure that Intellisense is causing the problem.</P>
<P><STRONG>2.&nbsp;Is there any corrupt file(s)</STRONG></P>
<P>If you are having some intellisense issues related with Project References,&nbsp;then you may also need to check the version of both the feacp.dll and vcpkg.dll files.</P>
<P>Here is a related <A class="" title="KB article" href="http://support.microsoft.com/kb/926465" target=_blank mce_href="http://support.microsoft.com/kb/926465">KB article</A>&nbsp;which links to the latest version of fix for this issue :</P>
<P>The intention to point to this article here is to get an understanding that these files are responsible for intellisense issues.</P>
<P><STRONG>3.&nbsp;Updating Intellisense – IDE hangs</STRONG></P>
<P>This is a very common issue with intellisense and it may occur due to a variety of reasons. There are two scenarios, either the intellisense returns after a long time or it doesn’t return at all.<BR>The recommended way is to check for NCB corruption and also getting the ACPLOG.</P>
<P><STRONG>4.&nbsp;NCB file corruption</STRONG></P>
<P>In some circumstances, NCB file becomes corrupted and thus the PARSER is unable to proceed resulting HANGS. Sometimes by deleting the NCB, the problem is resolved. But it may be a temporary workaround. The permanent solution is to find out which part of our code is causing failure.</P>
<P><STRONG>5.&nbsp;ACPlog</STRONG></P>
<P>We can generate a log file to findout the reasons behind the failure of parser. The ACPLOG can be generated from the Visual Studio IDE by adding the following option :<BR>&nbsp;<BR>/acplog:&lt;file_name_with_complete_path&gt;</P>
<P>If we build the solution, it will generate the log in the specified file. This is an ordinary text file which we can open in Notepad and can identify which part of our code is causing the parser to behave abnormally.<BR></P>
<P><STRONG>6.&nbsp;Intellisense and XML documentation </STRONG></P>
<P>Intellisense is also helpful in generating XML code comments. For example if we press three slashes(///), it will automatically add the code comments and may also try to include the elements very similar to the way we add variable in our code.</P>
<P><STRONG><A class="" title="Supplying XML Code Comments" href="http://msdn2.microsoft.com/en-us/library/s0we08bk(VS.80).aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/library/s0we08bk(VS.80).aspx">Supplying XML Code Comments</A></STRONG> <BR></P>
<P>I have encountered a case in which Intellisense was not responding after adding CDATA to XML documentation. </P>
<P>When customer complaints about the XML documentation code comments then it might be due to the Intellisense feature.</P>
<P><STRONG>7.&nbsp;Intellisense and network build&nbsp;</STRONG></P>
<P><A class="" title="Building a project/solution over network is not supported." href="http://support.microsoft.com/?kbid=255252" target=_blank mce_href="http://support.microsoft.com/?kbid=255252">Building a project/solution over&nbsp;network is unsupported</A>. It may encounter Intellisense issue. </P>
<P><STRONG>8.&nbsp;Is there any add-ins that the customer is using? </STRONG></P>
<P>Removing the add-in might resolve the issue.</P>
<P><STRONG>9.&nbsp;Opening a project when intellisense is busy?</STRONG></P>
<P>If Intellisense is in the middle of updating and if you open a different project by File-&gt;Recent projects, the IDE hangs and never comes back.&nbsp; <BR>It is suggested to wait for Intellisense to finish its work.</P>
<P><STRONG>10.&nbsp;Is there any antivirus installed?</STRONG></P>
<P>Try disabling the antivirus. There might be some conflict. </P>
<P><STRONG>11. Running Visual Studio in safemode.</STRONG></P>
<P>The safemode option in Visual Studio(Start-&gt;Run-&gt;devenv /safemode) ensures that no additional third party add-ins are loaded when VS starts. This helps us to isolate Visual Studio conflicts with other third party applications/addins.</P>
<P><STRONG><A class="" title="/SafeMode (devenv.exe)" href="http://msdn2.microsoft.com/en-us/library/ms241278(VS.80).aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/library/ms241278(VS.80).aspx">/SafeMode (devenv.exe)</A></STRONG></P>
<P><STRONG>&nbsp;</STRONG><STRONG>12. Is it a bug?</STRONG></P>
<P>Last but not the least, it would be a good idea to check <A class="" title="List of bugs that are fixed in Visual Studio 2005 Service Pack 1" href="http://support.microsoft.com/kb/918526" target=_blank mce_href="http://support.microsoft.com/kb/918526">List of bugs that are fixed in Visual Studio 2005 Service Pack 1<BR></A></P>
<P>Most of the known issues with Intellisense are going to be fixed very soon. You can contact <A class="" title="Microsoft Support" href="http://support.microsoft.com/" target=_blank mce_href="http://support.microsoft.com/">Microsoft Support</A>&nbsp;to get a hotfix.</P>
<P><STRONG><U>Some&nbsp;good links</U></STRONG></P>
<P><STRONG>&nbsp;<A class="" title="Troubleshooting IntelliSense in C++ Projects" href="http://msdn2.microsoft.com/en-us/library/ms235519(VS.80).aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/library/ms235519(VS.80).aspx">Troubleshooting IntelliSense in C++ Projects</A>&nbsp; </STRONG></P>
<P><STRONG>&nbsp;</STRONG><STRONG><A class="" title="When IntelliSense Is Unavailable" href="http://msdn2.microsoft.com/en-us/library/ks1ka3t6(VS.80).aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/library/ks1ka3t6(VS.80).aspx">When IntelliSense Is Unavailable</A></STRONG></P>
<P><STRONG>&nbsp;<A class="" title="Testing the IntelliSense engine" href="http://blogs.msdn.com/vcblog/archive/2007/07/05/testing-the-intellisense-engine.aspx" target=_blank mce_href="http://blogs.msdn.com/vcblog/archive/2007/07/05/testing-the-intellisense-engine.aspx">Testing the IntelliSense engine</A></STRONG> </P>
<P mce_keep="true">&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>Debugger not working</title>
      <link>https://docs.microsoft.com/archive/blogs/yash/debugger-not-working-2</link>
      <pubDate>Fri, 14 Sep 2007 18:30:00 GMT</pubDate>
      <dc:creator><![CDATA[Prabhatyash]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/yash/2007/09/14/debugger-not-working-2/</guid>
      <description><![CDATA[&nbsp;
Problem Description================
When you try to debug a simple windows application in...]]></description>
      <content:encoded><![CDATA[<P><STRONG></STRONG>&nbsp;</P>
<P><STRONG>Problem Description<BR>================</STRONG></P>
<P>When you try to debug a simple windows application in Visual Studio 2005, you get the following error :</P>
<P><BR>----------------------------------<BR>Microsoft Visual Studio<BR>----------------------------------<BR>Unable to start program '&lt;application_name&gt;'.A debugger dll, msdbg2.dll, is not correctly installed. Please repair your Visual Studio installation via 'Add or Remove Programs' in control panel.</P>
<P>If the problem persists, you can manually register msdbg2.dll from the command prompt with 'regsvr32 "%CommonProgramFiles%\Microsoft Shared\VS7Debug\msdbg.dll"'.<BR>----------------------------------<BR>OK&nbsp;&nbsp; <BR>----------------------------------</P>
<P mce_keep="true">&nbsp;</P>
<P mce_keep="true"><STRONG>Diagnostic<BR>=======</STRONG></P>
<P>We can use Debugger Diagnostic Tool to find out any error about this :</P>
<P>This Tool is available at :</P>
<P><A href="http://download.microsoft.com/download/a/6/f/a6f1de85-7284-4c97-9ddd-6f18000f5848/DebuggerDiagnostics.msi" mce_href="http://download.microsoft.com/download/a/6/f/a6f1de85-7284-4c97-9ddd-6f18000f5848/DebuggerDiagnostics.msi">http://download.microsoft.com/download/a/6/f/a6f1de85-7284-4c97-9ddd-6f18000f5848/DebuggerDiagnostics.msi</A> </P>
<P><BR>In order to simulate the problem, i tried to rename the msdbg2.dll file on my system and then run the DebuggerDiagnostic tool. The output that i get on my system is the following :</P>
<P><BR>C:\Documents and Settings\prabhatt\My Documents\MSDN\Debugger Diagnostics&gt;DebuggerDiagnostics.exe</P>
<P>Begin 'CheckMDMImage()'<BR>mdm.exe: version '7.10.3077' with hash '{6607858A-7B579EC3-E062DAB3-BF891368-CBF1CB9C}'.<BR>Result of 'CheckMDMImage()' is '00000000'</P>
<P>Begin 'CheckMSDBG2Image()'<BR>Could not calculate hash for 'msdbg2.dll' - 0x80070002<BR>Result of 'CheckMSDBG2Image()' is '80070002'</P>
<P>...</P>
<P>Begin 'CoCreateMachineDebugManager(&amp;spMachine)'<BR>Result of 'CoCreateMachineDebugManager(&amp;spMachine)' is '8007007e'</P>
<P mce_keep="true">&nbsp;</P>
<P><STRONG>Analysing the report<BR></STRONG>===============</P>
<P>We found that the following portion is reporting some error :</P>
<P><STRONG>Begin 'CheckMSDBG2Image()'<BR>Could not calculate hash for 'msdbg2.dll' - 0x80070002<BR>Result of 'CheckMSDBG2Image()' is '80070002'</STRONG></P>
<P>It states that it is unable to calculate the HASH value of the msdbg2.dll. Which indicates that there might be some problem with this DLL.</P>
<P mce_keep="true">&nbsp;</P>
<P><STRONG>Root Cause<BR>=======</STRONG></P>
<P>There are three causes of this issue :-<BR>1. The dll is not present physically at the specified path.<BR>2. The dll is corrupted due to some unknown reason.<BR>3. The dll is not the original one that comes with Visual Studio.</P>
<P mce_keep="true"><STRONG></STRONG>&nbsp;</P>
<P mce_keep="true"><STRONG>Conflict/Corrupt or missing msdbg2.dll<BR>=======================</STRONG></P>
<P>Once we identify that there are some issues with this dll, lets start identifying what might be the reason.</P>
<P>1. Manually search for the file in the directory C:\Program Files\Common Files\Microsoft Shared\VS7Debug</P>
<P>Is the file present there? If no we need to install the file there and register it properly.</P>
<P>There are several public sites from where we can download, install and register it. Since these sites might not be safe. I would recommend you to try installing the files from the installation disks of Visual Studio that you have.</P>
<P>2. If the file is physically present there, then it might be corrupted. So go ahead and install the new file from the installation disk and register it.</P>
<P>3. One interesting thing is that Office XP installation and Office XP update KB833858 also contain the same file msdbg2.dll. So if by any chance, if this file is installed by accident to the directory(C:\Program Files\Common Files\Microsoft Shared\VS7Debug) then also we may get this issue. We can verify this by checking the version, the file that comes with Visual Studio 2005&nbsp;has the version 8.0.50727.42. On the other hand the file that comes with Office XP update (KB833858) has the version 7.0.9466.0. If this is the case unregister the dll. Install the original one and register it.</P>
<P><STRONG></STRONG>&nbsp;</P>
<P><STRONG>How to Unregister a dll<BR>==============</STRONG></P>
<P>1. Start-&gt;Run-&gt;cmd.<BR>2. At a command prompt, type the following command: <BR>regsvr32 /u &lt;path_of_msdbg2.dll&gt;\msdbg2.dll&nbsp; </P>
<P><STRONG></STRONG>&nbsp;</P>
<P><STRONG>How to Register a dll<BR>=============</STRONG></P>
<P>1. Start-&gt;Run-&gt;cmd.<BR>2. At a command prompt, type the following command: <BR>regsvr32 &lt;path_of_msdbg2.dll&gt;\msdbg2.dll&nbsp; <BR></P>]]></content:encoded>
    </item>
  </channel>
</rss>