<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Bug Babble</title><link>http://blogs.msdn.com/b/stevejs/</link><description>Bugs, debuggers, stuff</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>Simple VS Addin (updated)</title><link>http://blogs.msdn.com/b/stevejs/archive/2005/12/21/506477.aspx</link><pubDate>Wed, 21 Dec 2005 22:41:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:506477</guid><dc:creator>SteveJS</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/stevejs/rsscomments.aspx?WeblogPostID=506477</wfw:commentRss><comments>http://blogs.msdn.com/b/stevejs/archive/2005/12/21/506477.aspx#comments</comments><description>&lt;DIV class=Section1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;Back during the PDC for Whidbey&amp;nbsp;I wrote a post about &lt;a href="http://blogs.msdn.com/stevejs/archive/2004/01/22/61901.aspx"&gt;Creating a Simple Addin&lt;/A&gt;.&amp;nbsp; Recently I was looking to update it and found a horrible bug in it.&amp;nbsp; First, here is the corrected code:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class=Section1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class=Section1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; OnConnection(&lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt; application, &lt;SPAN style="COLOR: teal"&gt;ext_ConnectMode&lt;/SPAN&gt; connectMode, &lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt; addInInst, &lt;SPAN style="COLOR: blue"&gt;ref&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;Array&lt;/SPAN&gt; custom)&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;_applicationObject = (&lt;SPAN style="COLOR: teal"&gt;DTE2&lt;/SPAN&gt;)application;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _addInInstance = (&lt;SPAN style="COLOR: teal"&gt;AddIn&lt;/SPAN&gt;)addInInst;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _debuggerEvents = _applicationObject.Events.DebuggerEvents;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _debuggerEvents.OnEnterBreakMode += &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;_dispDebuggerEvents_OnEnterBreakModeEventHandler&lt;/SPAN&gt;(DebuggerEvents_OnEnterBreakMode);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class=Section1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;DebuggerEvents&lt;/SPAN&gt; _debuggerEvents;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt; System.Collections.Generic.&lt;SPAN style="COLOR: teal"&gt;Queue&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: teal"&gt;EditPoint&lt;/SPAN&gt;&amp;gt; epQ = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; System.Collections.Generic.&lt;SPAN style="COLOR: teal"&gt;Queue&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: teal"&gt;EditPoint&lt;/SPAN&gt;&amp;gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; DebuggerEvents_OnEnterBreakMode(&lt;SPAN style="COLOR: teal"&gt;dbgEventReason&lt;/SPAN&gt; Reason, &lt;SPAN style="COLOR: blue"&gt;ref&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;dbgExecutionAction&lt;/SPAN&gt; ExecutionAction)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: teal"&gt;TextDocument&lt;/SPAN&gt; td = (&lt;SPAN style="COLOR: teal"&gt;TextDocument&lt;/SPAN&gt;) _applicationObject.ActiveDocument.Object(&lt;SPAN style="COLOR: maroon"&gt;"TextDocument"&lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: teal"&gt;EditPoint&lt;/SPAN&gt; ep = td.Selection.ActivePoint.CreateEditPoint();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;ep.SetBookmark();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;epQ.Enqueue(ep);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;if&lt;/SPAN&gt; (epQ.Count &amp;gt; 5)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; epQ.Dequeue().ClearBookmark();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;/SPAN&gt;&lt;BR&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;I've changed a couple of things.&amp;nbsp;&amp;nbsp;I now create the Editpoint first and use it to set the bookmark rather than setting the bookmark on the selection then creating an editpoint.&amp;nbsp; This removes that&amp;nbsp;possibility&amp;nbsp;that I&amp;nbsp;save a&amp;nbsp;different place then where&amp;nbsp;I set the bookmark.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;The&amp;nbsp;more important issue is I keep a member variable for _applicationObject.Events.DebuggerEvents.&amp;nbsp; Why?&amp;nbsp; Because it keeps&amp;nbsp;that&amp;nbsp;event provider&amp;nbsp;from getting garbage collected.&amp;nbsp; I had made the assumption that the lifetime of _applicationObject.Events.DebuggerEvents would be strictly tied to the DTE object, and managed by automation.&amp;nbsp; That is not the case.&amp;nbsp; The way this bug manifests is pretty ugly since the Addin works as expected for a while,&amp;nbsp;until the Event Provider (_applicationObject.Events.DebuggerEvents) is collected and Finalized, at which point the events just stop coming.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;I wasn't sure if this was by design or not.&amp;nbsp; However,&amp;nbsp;I found this KB article: &lt;A href="http://support.microsoft.com/default.aspx?scid=kb;en-us;555430"&gt;Visual Studio .Net events being disconnected from add-in&lt;/A&gt;,&amp;nbsp;so I am going with it being&amp;nbsp;by design.&lt;/SPAN&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=506477" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/stevejs/archive/tags/Bugs/">Bugs</category><category domain="http://blogs.msdn.com/b/stevejs/archive/tags/Visual+Studio/">Visual Studio</category><category domain="http://blogs.msdn.com/b/stevejs/archive/tags/Babble/">Babble</category></item><item><title>Naming threads in Win32 And .Net</title><link>http://blogs.msdn.com/b/stevejs/archive/2005/12/19/505815.aspx</link><pubDate>Tue, 20 Dec 2005 08:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:505815</guid><dc:creator>SteveJS</dc:creator><slash:comments>7</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/stevejs/rsscomments.aspx?WeblogPostID=505815</wfw:commentRss><comments>http://blogs.msdn.com/b/stevejs/archive/2005/12/19/505815.aspx#comments</comments><description>&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;When you are debugging an application with multiple threads it can be handy to have a better name than just the thread id.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is simple to do in managed code.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;There is a property on the Thread object that you can set.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It is also possible to do this for native code. However, there is simply no way you will ever discover it unless someone points you to&amp;nbsp;the difficult to find docs.&amp;nbsp; I knew about&amp;nbsp;the feature&amp;nbsp;and still missed&amp;nbsp;the docs&amp;nbsp;the first time I looked for them!&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;For completness, here is the managed version: &lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;A href="http://msdn.microsoft.com/library/en-us/vsdebug/html/vxconSettingThreadNameManaged.asp?frame=true"&gt;Setting a Thread Name (Managed)&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in; mso-outline-level: 1"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;The more interesting one is the native version: &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsdebug/html/vxtsksettingthreadname.asp"&gt;Setting a Thread Name (Unmanaged)&lt;/A&gt;&amp;nbsp;(There is a typo in the documentation's code; 'except' should be '__except'. I've included a corrected copy below.)&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;The native&amp;nbsp;method of setting the thread name&amp;nbsp;is&amp;nbsp;implemented by raising an SEH exception that is continued.&amp;nbsp; If you go to the docs on RaiseException you'll see&amp;nbsp;part of the reason for this strange mechanism.&amp;nbsp; An attached native debugger will get a 'first chance' notification of the exception.&amp;nbsp; Raising an exception is precisely what you need to do to get the native debugger's attention.&amp;nbsp;The one raised here (0x406D1388) is recognized by VS (and WinDbg).&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Note: If anything in your process installs a vectored exception handler, that handler will not&amp;nbsp;be called on this exception code&amp;nbsp;when the&amp;nbsp;VS debugger is attached.&amp;nbsp; The VS debugger always&amp;nbsp;handles this exception code and continues execution,&amp;nbsp;preventing any further handlers.&amp;nbsp;&amp;nbsp;In WinDbg you can go to Debug/Event Filters and set the "Visual C++&amp;nbsp;exception" to be disabled.&amp;nbsp;&amp;nbsp;With that setting,&amp;nbsp;your vectored exception handler will get a shot at 0x406D1388 while WinDbg is debugging it.&lt;/P&gt;&lt;PRE class=code&gt;//
// Usage: SetThreadName (-1, "MainThread");
//
typedef struct tagTHREADNAME_INFO
{
   DWORD dwType; // must be 0x1000
   LPCSTR szName; // pointer to name (in user addr space)
   DWORD dwThreadID; // thread ID (-1=caller thread)
   DWORD dwFlags; // reserved for future use, must be zero
} THREADNAME_INFO;

void SetThreadName( DWORD dwThreadID, LPCSTR szThreadName)
{
   THREADNAME_INFO info;
   info.dwType = 0x1000;
   info.szName = szThreadName;
   info.dwThreadID = dwThreadID;
   info.dwFlags = 0;

   __try
   {
      RaiseException( 0x406D1388, 0, sizeof(info)/sizeof(DWORD), (DWORD*)&amp;amp;info );
   }
   __except(EXCEPTION_CONTINUE_EXECUTION)
   {
   }
}&lt;/PRE&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;&lt;/SPAN&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=505815" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/stevejs/archive/tags/Bugs/">Bugs</category><category domain="http://blogs.msdn.com/b/stevejs/archive/tags/Visual+Studio/">Visual Studio</category><category domain="http://blogs.msdn.com/b/stevejs/archive/tags/Babble/">Babble</category></item><item><title>FuncEvil, the Clipboard, and Deadlocks</title><link>http://blogs.msdn.com/b/stevejs/archive/2005/12/08/501939.aspx</link><pubDate>Fri, 09 Dec 2005 10:22:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:501939</guid><dc:creator>SteveJS</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/stevejs/rsscomments.aspx?WeblogPostID=501939</wfw:commentRss><comments>http://blogs.msdn.com/b/stevejs/archive/2005/12/08/501939.aspx#comments</comments><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;Mike Stall has a great post that, for a debugger dev, is the moral equivalent of sticking a fork in a toaster.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The basic problem he addresses is that once you are stopped in the debugger the UI for your application will no longer paint.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;What if you need to see something on that UI? &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;If you like to live on the edge, Mike’s &lt;a href="http://blogs.msdn.com/jmstall/archive/2005/12/07/funceval_message_pump.aspx"&gt;Evil trick to render UI when stopped at a breakpoint&lt;/A&gt; is the answer for you.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Unfortunately, you need to be stopped on the UI thread for it to work.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Pumping messages on another thread will not unblock the UI to paint.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Even more unfortunate is that switching threads in the debugger won’t help.&amp;nbsp;&amp;nbsp;Function evaluation when debugging managed code requires you to be at a reasonable point on the thread. It is very unlikely you will randomly be at such a point, unless you stopped on the thread in question.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You can see the result I got when I stop on another thread, then switched to the UI thread:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;?System.Windows.Forms.MessageBox.Show("pump")&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Cannot evaluate expression because a thread is stopped at a point where garbage collection is impossible, possibly because the code is optimized.”&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Now don’t let this dissuade you from how useful this very, very, very dangerous trick can be.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Sometimes playing with fire is useful.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Not rendering the UI is only one problem that can happen due to the debugger stopping a process. &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;A really bad problem that lack of message pumping can cause is clipboard deadlock. &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;The real problem is&amp;nbsp;&lt;/SPAN&gt;due to delayed rendering, which requires the app that copied to the clipboard to be live.&amp;nbsp; You can read about delayed rendering&amp;nbsp;on the MSDN &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/dataexchange/clipboard/clipboardoperations.asp"&gt;Clipboard Operations&lt;/A&gt; page.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The basic problem is that the application you are debugging owns the clipboard, and other apps need it to respond to messages to get the contents of the clipboard. You can see this by creating a trivial winform app with a button and a RichTextbox:&lt;/P&gt;
&lt;P&gt;
&lt;P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/41403334@N00/71710810/"&gt;&lt;IMG height=301 alt=TrivialWinForm src="http://static.flickr.com/35/71710810_c1a4882f5b_o.png" width=304&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;(Note you need to use a RichTextBox here … a normal TextBox will actually copy the contents to the clipboard rather than using delayed rendering.)&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;First set a breakpoint in the button handler.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Then select the “Copy me at your own Risk!” text and copy it to the clipboard with Ctrl-C.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Now hit the button.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Nothing is wrong yet.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;However if you go to any application and hit paste that application is now hung, and will remain so until you continue from the breakpoint.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If you hit paste in the debugger you’ll deadlock that too without any way to continue from the bp.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;Clipboard deadlock&amp;nbsp;has hit me few a times composing mail while stopped at a breakpoint.&amp;nbsp;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt; &lt;/SPAN&gt;Using the trick that Mike outlines does free&amp;nbsp;the applications&amp;nbsp;waiting for your winform app to provide the clipboard data. &lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;If you do not understand why func eval is evil I must end by pointing you to Mike's older post &lt;a href="http://blogs.msdn.com/jmstall/archive/2005/03/23/400794.aspx"&gt;Func-eval is evil&lt;/A&gt;, and GreggM's more recent&amp;nbsp;post &lt;A id=_ctl0__ctl0__ctl0__ctl0_RecentPosts__ctl0_postlist__ctl0_EntryItems__ctl0_PostTitle href="/greggm/archive/2005/11/18/494648.aspx"&gt;&lt;FONT color=#006bad&gt;Func eval and System.Windows.Forms.Form&lt;/FONT&gt;&lt;/A&gt;.&amp;nbsp; Func Eval is powerful, and with great power comes a bunch of power to shoot yourself in the foot.&amp;nbsp; Be careful using func eval.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=501939" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/stevejs/archive/tags/Bugs/">Bugs</category><category domain="http://blogs.msdn.com/b/stevejs/archive/tags/Visual+Studio/">Visual Studio</category><category domain="http://blogs.msdn.com/b/stevejs/archive/tags/Babble/">Babble</category></item><item><title>Change Debugger behavior with Attributes</title><link>http://blogs.msdn.com/b/stevejs/archive/2005/12/03/499803.aspx</link><pubDate>Sun, 04 Dec 2005 00:54:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:499803</guid><dc:creator>SteveJS</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/stevejs/rsscomments.aspx?WeblogPostID=499803</wfw:commentRss><comments>http://blogs.msdn.com/b/stevejs/archive/2005/12/03/499803.aspx#comments</comments><description>&lt;DIV class=Section1&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Certain metadata attributes modify the stepping, breakpoint, and callstack behavior of the VS managed Debugger.&amp;nbsp; This is useful if you are creating an interpreter, language runtime, or a tool that modifies the code in a managed assembly.&amp;nbsp; There are three flavors of these attributes that affect execution control.&amp;nbsp; Each behaves slightly differently, and I always forget which does what, so I'm recording it here for my own reference as well.&amp;nbsp;&lt;/SPAN&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;/SPAN&gt;&amp;nbsp;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;The code below shows examples using all three attributes: DebuggerStepThrough, DebuggerHidden, and DebuggerNonUserCode.&amp;nbsp; The example also shows the hidden line directive.&amp;nbsp;&amp;nbsp;I've inlined the explanation as comments in the code so it can travel with the example.&amp;nbsp;&amp;nbsp;This general area of writing tools that interact with the debugger has been well explored on Mike Stall's blog:&lt;/SPAN&gt;&lt;BR&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;/SPAN&gt;&amp;nbsp;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;a href="http://blogs.msdn.com/jmstall/archive/2005/06/19/FeeFee_SequencePoints.aspx"&gt;#line hidden and 0xFeeFee sequence points&lt;/A&gt;&lt;/SPAN&gt;&lt;BR&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;a href="http://blogs.msdn.com/jmstall/archive/2004/12/31/344832.aspx"&gt;How can I debug Just My Code?&lt;/A&gt;&lt;/SPAN&gt;&lt;BR&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;a href="http://blogs.msdn.com/jmstall/archive/2005/07/27/state_machine_theory.aspx"&gt;Debug support for arbitrary state-machines&lt;/A&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;using&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; System;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// This example shows the use of the three debugger attributes&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// that modify the runtime behavior of the VS debugger.&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// The motivating example is part of an AOP (Aspect Oriented Programming)&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// implemenatation.&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// The concepts around AOP are pretty interesting, but for this&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// example it is sufficient to know that anything called a 'Thunk'&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// is something added by the tool that is of no interest to the user.&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// The example code is what a weaver that uses C# as a backend could &lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// send to the compiler to accomplish the hiding of &lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// JoinPointThunks, and the calls to those thunks.&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// Try stepping through this with this option on:&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// Tools/Options/Debugging/General/Enable Just My Code&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// Then try the same with the option off.&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// You'll see that each attribute creates a slightly different end user&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// behavior and slightly different ease of debugging for yourself&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// when you need to debug the glue code you are hiding from the user.&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;class&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; &lt;SPAN style="COLOR: teal"&gt;DynamicallyAddedUserCode&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;{&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; bar()&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: teal"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: maroon"&gt;"Hello advice\n"&lt;/SPAN&gt;);&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;};&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;class&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; &lt;SPAN style="COLOR: teal"&gt;Weaver&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;{&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [System.Diagnostics.&lt;SPAN style="COLOR: teal"&gt;DebuggerStepThrough&lt;/SPAN&gt;]&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; ExampleJoinPointThunk_withDebuggerStepThrough()&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//_________________________________________________________________&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// Tools/Options/Debugging/Enable Just My Code ON:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//CALLSTACK view: Frame is viewable&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//BP: Will hit bp.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//STEPPING:&amp;nbsp; Will not stop inside due to a step.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// (Even from bp hit! Any step is a step out.)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// Step in will land inside called methods.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//_________________________________________________________________&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// Tools/Options/Debugging/Enable Just My Code OFF:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: green"&gt;//CALLSTACK view: [External Code] frame.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//&amp;nbsp;&amp;nbsp; Real frame is viewable by selecting 'Show External Code'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//&amp;nbsp;&amp;nbsp; in Callstack window.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//BP: No bp will set or hit. A warning is provided, &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//STEPPING: Will not stop inside method (step in or step out)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//&amp;nbsp; A step in will land in called methods.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//_________________________________________________________________&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: teal"&gt;DynamicallyAddedUserCode&lt;/SPAN&gt;.bar();&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; thisGoesTo = 11;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [System.Diagnostics.&lt;SPAN style="COLOR: teal"&gt;DebuggerHidden&lt;/SPAN&gt;]&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; ExampleJoinPointThunk_withDebuggerHidden()&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//_________________________________________________________________&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// Tools/Options/Debugging/Enable Just My Code ON:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//CALLSTACK view: Frame is completely hidden.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//BP: A Bp will set with no error, but will not hit!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//stepping: A Step in will land in called methods.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//_________________________________________________________________&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// Tools/Options/Debugging/Enable Just My Code OFF:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//CALLSTACK view: Frame is completely hidden. (i.e. No [External Code])&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//BP:Warning provided, no bp will set or hit.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//STEPPING: Will not stop inside method (step in or step out)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//&amp;nbsp; A step in will land in called methods.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//_________________________________________________________________&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: teal"&gt;DynamicallyAddedUserCode&lt;/SPAN&gt;.bar();&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; thisGoesTo = 11;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [System.Diagnostics.&lt;SPAN style="COLOR: teal"&gt;DebuggerNonUserCode&lt;/SPAN&gt;]&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; ExampleJointPointThunk_withDebuggerNonUserCode()&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//_________________________________________________________________&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// [Same as normal code.]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// Tools/Options/Debugging/Enable Just My Code ON: &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//CALLSTACK view: &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;Normal&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt; view, callstack is viewable.&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//BP: A bp will set and hit.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//STEPPING: Step as normal.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//_________________________________________________________________&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// [Same as Debugger StepThrough]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// Tools/Options/Debugging/Enable Just My Code OFF&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//CALLSTACK view:[ External Code] frame.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//&amp;nbsp;&amp;nbsp; Real frame is viewable by selecting 'Show External Code'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//&amp;nbsp;&amp;nbsp; in Callstack window.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//BP: Warning provided, no bp will set or hit.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//STEPPING:&amp;nbsp; Will not stop inside method (step in or step out)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//&amp;nbsp; A step in will land in called methods.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//_________________________________________________________________&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: teal"&gt;DynamicallyAddedUserCode&lt;/SPAN&gt;.bar();&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; thisGoesTo = 11;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;};&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;class&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; &lt;SPAN style="COLOR: teal"&gt;Program&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;{&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; foo()&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;#line&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; hidden&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//this emits a Sequence Point with line = 0xFeeFEE&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;//Imagine these hidden areas were added dynamically&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: teal"&gt;Weaver&lt;/SPAN&gt;.ExampleJoinPointThunk_withDebuggerStepThrough();&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;#line&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; default&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; theone = 1;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;#line&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; hidden&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: teal"&gt;Weaver&lt;/SPAN&gt;.ExampleJoinPointThunk_withDebuggerHidden();&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;#line&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; default&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; volume = 11;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;#line&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; hidden&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: teal"&gt;Weaver&lt;/SPAN&gt;.ExampleJointPointThunk_withDebuggerNonUserCode();&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;#line&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; default&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; answer = 42;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;Main&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;(&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;[] args)&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foo();&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;}&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// The #line hidden directive places 0xFeeFee sequence point in the line &lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// information. The 0xFeeFee sequence point tells the debugger to continue&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// stepping.&amp;nbsp; It is not necessary unless a step can end at the location.&amp;nbsp; &lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// If you are writing a compiler and emitting your own debug information,&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// then it is often possible to simply omit the line info for code that would&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// be marked hidden. If you decompile the above code with ILDasm /Linenum you&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// will see an example of that strategy.&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// However there are cases where it is important to use the a hidden sequence&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// point. Any place where a branch instruction lands must use a hidden sequence&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// point if you do not want the debugger to stop there.&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;//&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// The motivating example for this is having all exit points from a Try block&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// branch to a single leave instruction.&amp;nbsp; If you produce that type of codegen&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// you will need to use 0xFeeFee to create reasonable stepping behavior.&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P class=Section1 style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=499803" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/stevejs/archive/tags/Bugs/">Bugs</category><category domain="http://blogs.msdn.com/b/stevejs/archive/tags/Visual+Studio/">Visual Studio</category><category domain="http://blogs.msdn.com/b/stevejs/archive/tags/Babble/">Babble</category></item><item><title>Netmodules: Sort of like a lib</title><link>http://blogs.msdn.com/b/stevejs/archive/2005/11/27/497333.aspx</link><pubDate>Mon, 28 Nov 2005 06:19:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:497333</guid><dc:creator>SteveJS</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/stevejs/rsscomments.aspx?WeblogPostID=497333</wfw:commentRss><comments>http://blogs.msdn.com/b/stevejs/archive/2005/11/27/497333.aspx#comments</comments><description>&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;I first ran into netmodules before VS 2002 was shipped. The netmodule gave me precisely what I asked for, without actually solving my problem.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I wanted to use multiple languages (C#, and C++ /clr)&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;in a single assembly.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It turns out a single assembly can be multi-module.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; Multi-module means a single .Net assembly is spread across multiple win32 dlls. &amp;nbsp;&lt;/SPAN&gt;What I really wanted was a single module&amp;nbsp;assembly written in multiple languages. Netmodules couldn't solve my problem back then, but with the VS 2005&amp;nbsp;C++ linker&amp;nbsp;they can now.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Check out JuFeng's articles for some more in depth coverage, and an explanation why you might want a multi-module assembly:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;a href="http://blogs.msdn.com/junfeng/archive/2004/07/15/183813.aspx"&gt;MultiModule Assemblies&lt;/A&gt; &lt;/P&gt;
&lt;P style="MARGIN: 0in; mso-outline-level: 1"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;a href="http://blogs.msdn.com/junfeng/archive/2005/02/12/371683.aspx"&gt;Netmodule vs. Assembly&lt;/A&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Since JuFeng's examples didn't show how to create debug info I thought I'd make an updated example here.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Here's a quick example with a multi-module assembly:&lt;/P&gt;
&lt;P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/41403334@N00/67750045/"&gt;&lt;IMG height=195 alt=a_source src="http://static.flickr.com/26/67750045_149369f8c9_o.png" width=273&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/41403334@N00/67750046/"&gt;&lt;IMG height=105 alt=b_source src="http://static.flickr.com/34/67750046_ce07feeb38_o.png" width=238&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;From the Visual Studio&amp;nbsp; 2005 Command Prompt:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;C:\blog\linkexample&amp;gt;vbc /target:module /debug+ b.vb&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;C:\blog\linkexample&amp;gt;csc /debug+ /addmodule:b.netmodule a.cs&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;C:\blog\linkexample&amp;gt;devenv /debugexe a.exe&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Check out the modules window:&lt;/P&gt;
&lt;P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/41403334@N00/67750048/"&gt;&lt;IMG height=74 alt=multi_module src="http://static.flickr.com/26/67750048_6436579988_o.png" width=709&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;And the callstack window:&lt;/P&gt;
&lt;P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/41403334@N00/67755934/"&gt;&lt;IMG height=88 alt=multi2_callstack src="http://static.flickr.com/29/67755934_08261ecb38_o.png" width=294&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;To get a single file assembly I'll need to recompile the cs file into a netmodule then use the c++ linker.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;C:\blog\linkexample&amp;gt;csc /addmodule:b.netmodule /target:module /debug+ a.cs&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;C:\blog\linkexample&amp;gt;link /entry:fooCS.Main /out:theone.exe /subsystem:console /debug a.netmodule b.netmodule&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;C:\blog\linkexample&amp;gt;devenv /debugexe theone.exe&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Now check out the modules window:&lt;/P&gt;
&lt;P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/41403334@N00/67750050/"&gt;&lt;IMG height=54 alt=single_module src="http://static.flickr.com/34/67750050_5b72c149be_o.png" width=730&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;And the callstack window:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/41403334@N00/67755935/"&gt;&lt;IMG height=79 alt=single2_callstack src="http://static.flickr.com/32/67755935_9777ee3976_o.png" width=321&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=497333" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/stevejs/archive/tags/Bugs/">Bugs</category><category domain="http://blogs.msdn.com/b/stevejs/archive/tags/Visual+Studio/">Visual Studio</category><category domain="http://blogs.msdn.com/b/stevejs/archive/tags/Babble/">Babble</category></item><item><title>XSLT debugging in Visual Studio</title><link>http://blogs.msdn.com/b/stevejs/archive/2005/11/16/493805.aspx</link><pubDate>Thu, 17 Nov 2005 10:40:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:493805</guid><dc:creator>SteveJS</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/stevejs/rsscomments.aspx?WeblogPostID=493805</wfw:commentRss><comments>http://blogs.msdn.com/b/stevejs/archive/2005/11/16/493805.aspx#comments</comments><description>&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Visual Studio is a big tool.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It's easy to miss some useful features.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; Hopefully t&lt;/SPAN&gt;he XSLT debugger won't get missed.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;If you want to learn how to use XSLT debugging take a look at Neetu Rajpal's msdn article &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxmlnet/html/xmltools.asp"&gt;Introducing Xml tools in VS 2005&lt;/A&gt;.&amp;nbsp; Below you can see the debugger in action as an xslt transform is being applied to some XML. &lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;(Please excuse the nonsense XSLT I use in the example.&amp;nbsp; I haven't had a chance to play around with XSLT for quite some time.)&lt;/P&gt;
&lt;P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/41403334@N00/64132295/"&gt;&lt;IMG height=179 alt=XSLTdebugging src="http://static.flickr.com/33/64132295_840be0980d_o.png" width=652&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;XSLT debugging is interesting to me because much of it is the managed debugger.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;XSLT is compiled to msil, and the managed debugger is used to provide things like breakpoints and stepping.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;You can see this by opening the modules window.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You'll see in the last column that the process is a managed process called the Microsoft.XSLDebugProxy.exe, and there will be some modules loaded with names like System.Xml.Xsl.CompiledQuery.1.&amp;nbsp;&amp;nbsp;&amp;nbsp;All of the debugger windows work as expected: callstack, locals, immediate, threads, modules.&amp;nbsp; You can see below the callstack for my nonsense example:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/41403334@N00/64135280/"&gt;&lt;IMG height=100 alt=XSLTcallstackwithJMC src="http://static.flickr.com/30/64135280_a911535011_o.png" width=476&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;However! Go to the callstack window and right click to get the context menu.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;There will be an item called Show External Code.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Pick that and you get to see much in the callstack window that was hidden before.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The grey colored frames are&amp;nbsp;because there is no debug info (pdb file) for that assembly, which is why those frames were marked as 'External Code' before.&amp;nbsp; The CompiledQuery frames were hidden because the XSLT compiler placed an attribute on them to tell the debugger they were not of interest.&amp;nbsp;&amp;nbsp; With the expanded view&amp;nbsp;you can now&amp;nbsp;see the compiled query and the code that dispatched it.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/41403334@N00/64135279/"&gt;&lt;IMG height=457 alt=XSLTCallstackWithoutJMC src="http://static.flickr.com/29/64135279_3386e1de8d_o.png" width=467&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;&lt;FONT size=2&gt;However, while that is interesting it is unlikely to help you get at a bug in your XSLT.&amp;nbsp; The Locals window however appears to be one of the more useful windows, that can help you see what is happening as the transforms are applied.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/41403334@N00/64137060/"&gt;&lt;IMG height=126 alt=LocalsWindowXSLTdebugging src="http://static.flickr.com/35/64137060_f5844b842a_o.png" width=520&gt;&lt;/A&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=493805" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/stevejs/archive/tags/Bugs/">Bugs</category><category domain="http://blogs.msdn.com/b/stevejs/archive/tags/Visual+Studio/">Visual Studio</category></item><item><title>Edit and Continue on 64 bit Windows</title><link>http://blogs.msdn.com/b/stevejs/archive/2005/11/15/493018.aspx</link><pubDate>Tue, 15 Nov 2005 21:10:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:493018</guid><dc:creator>SteveJS</dc:creator><slash:comments>11</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/stevejs/rsscomments.aspx?WeblogPostID=493018</wfw:commentRss><comments>http://blogs.msdn.com/b/stevejs/archive/2005/11/15/493018.aspx#comments</comments><description>&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;A href="http://bloggingabout.net/blogs/pascal/archive/2005/10/20/9913.aspx"&gt;Pascal&amp;nbsp;writes&lt;/A&gt; about the joy of x64 Windows XP, and some drawbacks.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;One drawback is no Edit and Continue using the 64 bit CLR.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You can, however, use E&amp;amp;C against the 32 bit CLR on a x64 machine.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Here's how you do it:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;You need to compile your managed assembly with a target CPU of x86.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This will cause the 32 bit CLR to be used rather than the 64 bit CLR.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;For a VB Project, right click on the project and go to Properties/Compile/Advanced Compile Options/Target CPU and set it to "x86".&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;For a C# Project, right click on the project and go to Properites/Build/Platform Target and set it to "x86".&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;If you want to (or must) use the 64 bit CLR, we unfortunately cannot provide E&amp;amp;C.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; In C# if you try to edit t&lt;/SPAN&gt;here is a dialog that tells you edits are not allowed .&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; To prevent the dialog, &lt;/SPAN&gt;disable E&amp;amp;C: Tools/Options/Debugging/Edit and Continue, and uncheck 'Enable Edit and Continue'.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=493018" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/stevejs/archive/tags/Visual+Studio/">Visual Studio</category></item><item><title>Make DataTips Transparent</title><link>http://blogs.msdn.com/b/stevejs/archive/2005/11/12/492115.aspx</link><pubDate>Sat, 12 Nov 2005 20:08:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:492115</guid><dc:creator>SteveJS</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/stevejs/rsscomments.aspx?WeblogPostID=492115</wfw:commentRss><comments>http://blogs.msdn.com/b/stevejs/archive/2005/11/12/492115.aspx#comments</comments><description>&lt;P&gt;Enhanced datatips are my favorite new debugger feature. However, sometimes you want to see underneath&amp;nbsp;the tip&amp;nbsp;without losing your spot. Fortunately, &lt;a href="http://blogs.msdn.com/jimgries/"&gt;JimGries&lt;/A&gt; thought of that. You can make the DataTip transparent by pressing the ctrl key or middle mouse button. &lt;/P&gt;
&lt;P&gt;Here is an Enhanced DataTip In Visual Studio 2005: &lt;/P&gt;
&lt;P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/41403334@N00/62471145/"&gt;&lt;IMG height=294 alt=EnahncedToolTip src="http://static.flickr.com/27/62471145_37486a515b_o.png" width=456&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Here is the same DataTip with the Crtl key pressed:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/41403334@N00/62471147/"&gt;&lt;IMG height=293 alt=EnhancedToolTipWithCtrlPressed src="http://static.flickr.com/31/62471147_152baf2f99_o.png" width=453&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Update: JimGries pointed out that you can also make the DataTip transparent by pressing the middle mouse button (or wheel).&amp;nbsp; If you have the wheel (and who doesn't today) you can also scroll with it, just as you'd expect.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=492115" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/stevejs/archive/tags/Visual+Studio/">Visual Studio</category></item><item><title>Post Mortems</title><link>http://blogs.msdn.com/b/stevejs/archive/2005/11/10/491389.aspx</link><pubDate>Thu, 10 Nov 2005 20:18:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:491389</guid><dc:creator>SteveJS</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/stevejs/rsscomments.aspx?WeblogPostID=491389</wfw:commentRss><comments>http://blogs.msdn.com/b/stevejs/archive/2005/11/10/491389.aspx#comments</comments><description>&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;I won the guess the murderer contest.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Shai and I compete to guess who the real murderer is on Law and Order Criminal Intent.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Last night we watched Sunday's two hour show.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It's a toss up who wins, but one of us always gets it by two thirds of the way through.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;That's the point where the amount of time left means the current suspect can't be the real murderer, and typically there was only one other possible suspect.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The more unlikely the suspect, the higher our certainty.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;That just makes for better TV.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;This mechanism of diagnosis is not very helpful for figuring out real world problems.&amp;nbsp; There is no way to use a Tivo to tell you everything will be resolved in the next 20 minutes.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It does however have something in common with Post Mortems.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;A Post Mortem is where the team shines the bright light of 20/20 hindsight on all the decisions that were hard.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This perspective is much like having the extra knowledge that everything&amp;nbsp;will be wrapped up in 20 minutes.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Things that were unknowns are now knowns.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Those tough calls that could have caused problems, yet no problems appeared: obviously good decisions.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Those tough calls that did cause problems: obviously we shouldn't do that again … duh!&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Unfortunately these fantastic insights are entirely informed via knowledge&amp;nbsp;not present at the time the decision was made.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I'm certainly not saying that Post mortems are useless!&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It's just that after you've categorized the bad decisions and the good decisions you still need to synthesize some useful advice that does not require precognition to use properly.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;On the other hand, making decisions based on what makes for good TV sounds like it could be fun.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=491389" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/stevejs/archive/tags/Babble/">Babble</category></item><item><title>Perf Awareness is not Premature </title><link>http://blogs.msdn.com/b/stevejs/archive/2005/11/06/489644.aspx</link><pubDate>Mon, 07 Nov 2005 02:38:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:489644</guid><dc:creator>SteveJS</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/stevejs/rsscomments.aspx?WeblogPostID=489644</wfw:commentRss><comments>http://blogs.msdn.com/b/stevejs/archive/2005/11/06/489644.aspx#comments</comments><description>&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;I've&amp;nbsp;found myself adding a timer to each of the unit test frameworks I use so I can see how long my tests take.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I am not trying to do anything complex.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I just want to be aware of&amp;nbsp;the perf.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The same way pass and fail are visible, 1ms vs 90ms is visible. &lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Premature optimization rightly has a bad rep.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Creating&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;complex code where performance doesn't matter is a bad tradeoff.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;That's not what I'm doing here.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I&amp;nbsp;am not trying to code for perf.&amp;nbsp; I'm trying to be perf aware.&amp;nbsp; If&amp;nbsp;the test&amp;nbsp;is fast I'm certainly not going to use that as an excuse to&amp;nbsp;start changing code.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If it's slow, I know about it and I won't check in something that kills perf.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; Once you have a number, t&lt;/SPAN&gt;he real question is: How do you judge if it is&amp;nbsp;fast or slow?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; The answer is a perf budget.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Rico Mariani has a great &lt;a href="http://blogs.msdn.com/ricom/archive/2003/12/12/43245.aspx"&gt;Designing for Performance&lt;/A&gt;&amp;nbsp;post where he talks about&amp;nbsp;using Perf budgets.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;In the absence of a perf budget, spend your time getting a perf budget rather than mucking about with code.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Once you have perf budgets, being aware of resource consumption makes it easier to see problems earlier.&amp;nbsp; A perf problem is a bug.&amp;nbsp; Fixing a&amp;nbsp;bug before it gets into the source tree is always a good idea.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=489644" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/stevejs/archive/tags/Bugs/">Bugs</category><category domain="http://blogs.msdn.com/b/stevejs/archive/tags/Babble/">Babble</category></item></channel></rss>