<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: Exceptional Exception Handling Behavior</title> <atom:link href="http://davybrion.com/blog/2008/10/exceptional-exception-handlingbehavior/feed/" rel="self" type="application/rss+xml" /><link>http://davybrion.com/blog/2008/10/exceptional-exception-handlingbehavior/</link> <description>inquisitive: adjective. given to inquiry, research, or asking questions; eager for knowledge; intellectually curious</description> <lastBuildDate>Sun, 20 May 2012 21:55:00 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>By: Peter</title><link>http://davybrion.com/blog/2008/10/exceptional-exception-handlingbehavior/comment-page-1/#comment-3691</link> <dc:creator>Peter</dc:creator> <pubDate>Fri, 17 Oct 2008 05:42:31 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=501#comment-3691</guid> <description>I recommend that everybody that confirmed in the comments that they could repro, confirm this on the connect site as well.</description> <content:encoded><![CDATA[<p>I recommend that everybody that confirmed in the comments that they could repro, confirm this on the connect site as well.</p> ]]></content:encoded> </item> <item><title>By: Davy Brion</title><link>http://davybrion.com/blog/2008/10/exceptional-exception-handlingbehavior/comment-page-1/#comment-3620</link> <dc:creator>Davy Brion</dc:creator> <pubDate>Wed, 15 Oct 2008 13:38:16 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=501#comment-3620</guid> <description>I&#039;ve heard from someone at MS that this bug is only present on X86too bad they don&#039;t update connect...</description> <content:encoded><![CDATA[<p>I&#8217;ve heard from someone at MS that this bug is only present on X86</p><p>too bad they don&#8217;t update connect&#8230;</p> ]]></content:encoded> </item> <item><title>By: Davy Brion</title><link>http://davybrion.com/blog/2008/10/exceptional-exception-handlingbehavior/comment-page-1/#comment-3494</link> <dc:creator>Davy Brion</dc:creator> <pubDate>Mon, 13 Oct 2008 05:05:51 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=501#comment-3494</guid> <description>he&#039;s probably too busy preparing his Silverlight presentation ;)</description> <content:encoded><![CDATA[<p>he&#8217;s probably too busy preparing his Silverlight presentation <img
src='http://d18sni7re4ly7f.cloudfront.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: Koen</title><link>http://davybrion.com/blog/2008/10/exceptional-exception-handlingbehavior/comment-page-1/#comment-3475</link> <dc:creator>Koen</dc:creator> <pubDate>Sun, 12 Oct 2008 20:59:48 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=501#comment-3475</guid> <description>Did scottgu reply yet?</description> <content:encoded><![CDATA[<p>Did scottgu reply yet?</p> ]]></content:encoded> </item> <item><title>By: Davy Brion</title><link>http://davybrion.com/blog/2008/10/exceptional-exception-handlingbehavior/comment-page-1/#comment-3422</link> <dc:creator>Davy Brion</dc:creator> <pubDate>Sat, 11 Oct 2008 13:29:48 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=501#comment-3422</guid> <description>I submitted a bug to Microsoft Connect for this:https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=374919</description> <content:encoded><![CDATA[<p>I submitted a bug to Microsoft Connect for this:</p><p><a
href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=374919" rel="nofollow">https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=374919</a></p> ]]></content:encoded> </item> <item><title>By: Davy Brion</title><link>http://davybrion.com/blog/2008/10/exceptional-exception-handlingbehavior/comment-page-1/#comment-3387</link> <dc:creator>Davy Brion</dc:creator> <pubDate>Fri, 10 Oct 2008 09:30:20 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=501#comment-3387</guid> <description>dunno if that&#039;s actually causing the problem... especially because it can be reproduced with very simple code in both a unit test environment and a console application (and i really can&#039;t imagine some kind of background code in a console application causing different debugger behavior). And the code itself doesn&#039;t make any calls to System.Diagnostics.Debugger at all...the thing is... the catch (T exception) is not entered, but the catch (Exception e) is entered. And if you then do a (T)e call, it just works. But since the catch (T exception) is listed before the catch (Exception e), and the exception is indeed of type T, then it should in all cases enter the catch(T exception) clause.</description> <content:encoded><![CDATA[<p>dunno if that&#8217;s actually causing the problem&#8230; especially because it can be reproduced with very simple code in both a unit test environment and a console application (and i really can&#8217;t imagine some kind of background code in a console application causing different debugger behavior). And the code itself doesn&#8217;t make any calls to System.Diagnostics.Debugger at all&#8230;</p><p>the thing is&#8230; the catch (T exception) is not entered, but the catch (Exception e) is entered. And if you then do a (T)e call, it just works. But since the catch (T exception) is listed before the catch (Exception e), and the exception is indeed of type T, then it should in all cases enter the catch(T exception) clause.</p> ]]></content:encoded> </item> <item><title>By: Patrick</title><link>http://davybrion.com/blog/2008/10/exceptional-exception-handlingbehavior/comment-page-1/#comment-3386</link> <dc:creator>Patrick</dc:creator> <pubDate>Fri, 10 Oct 2008 09:17:46 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=501#comment-3386</guid> <description>Check the following link for the solution: http://blogs.msdn.com/jmstall/archive/2004/10/02/236942.aspxThe relevant portion is copied below.User checks: The biggest culprit: A program can explicitly call System.Diagnostics.Debugger.IsAttached to ask if a managed debugger is attached and then behave differently.  (The win32 API IsDebuggerPresent() similarly checks for if a native debugger is attached.). This is the easiest way to cause the most pain. For example, WinForms will explicitly use a different &#039;debuggable&#039; WndProc if a managed debugger is attached. This debuggable wndproc has an extra try-catch around user callbacks (which the non-debuggable wndproc does not have) to notify users if their callbacks are throwing exceptions. Another favorite seems to be throwing exceptions iff a debugger is attached as way of notifying the user.</description> <content:encoded><![CDATA[<p>Check the following link for the solution: <a
href="http://blogs.msdn.com/jmstall/archive/2004/10/02/236942.aspx" rel="nofollow">http://blogs.msdn.com/jmstall/archive/2004/10/02/236942.aspx</a></p><p>The relevant portion is copied below.</p><p>User checks: The biggest culprit: A program can explicitly call System.Diagnostics.Debugger.IsAttached to ask if a managed debugger is attached and then behave differently.  (The win32 API IsDebuggerPresent() similarly checks for if a native debugger is attached.). This is the easiest way to cause the most pain. For example, WinForms will explicitly use a different &#8216;debuggable&#8217; WndProc if a managed debugger is attached. This debuggable wndproc has an extra try-catch around user callbacks (which the non-debuggable wndproc does not have) to notify users if their callbacks are throwing exceptions. Another favorite seems to be throwing exceptions iff a debugger is attached as way of notifying the user.</p> ]]></content:encoded> </item> <item><title>By: den Ben</title><link>http://davybrion.com/blog/2008/10/exceptional-exception-handlingbehavior/comment-page-1/#comment-3384</link> <dc:creator>den Ben</dc:creator> <pubDate>Fri, 10 Oct 2008 08:06:28 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=501#comment-3384</guid> <description>Hmms... this truly is a challenge.  And I was so hoping to be your Hero Of The Week :pFact is:  Google isn&#039;t going to be much of a help either.  When you search for: &quot;catch (T &quot; debugger 3.5...this article is at the top of the list ;-)</description> <content:encoded><![CDATA[<p>Hmms&#8230; this truly is a challenge.  And I was so hoping to be your Hero Of The Week :p</p><p>Fact is:  Google isn&#8217;t going to be much of a help either.  When you search for: &#8220;catch (T &#8221; debugger 3.5</p><p>&#8230;this article is at the top of the list <img
src='http://d18sni7re4ly7f.cloudfront.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: Davy Brion</title><link>http://davybrion.com/blog/2008/10/exceptional-exception-handlingbehavior/comment-page-1/#comment-3383</link> <dc:creator>Davy Brion</dc:creator> <pubDate>Fri, 10 Oct 2008 07:47:37 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=501#comment-3383</guid> <description>nope, resharper runs the tests without the debugger by default, so it doesn&#039;t need it... it can just listen to the proper events from the nunit testrunner classes to get all of that information :)it can&#039;t be resharper because i just remembered that i also have the problem when running the tests with the Testdriven.NET (with the debugger enabled)</description> <content:encoded><![CDATA[<p>nope, resharper runs the tests without the debugger by default, so it doesn&#8217;t need it&#8230; it can just listen to the proper events from the nunit testrunner classes to get all of that information <img
src='http://d18sni7re4ly7f.cloudfront.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p>it can&#8217;t be resharper because i just remembered that i also have the problem when running the tests with the Testdriven.NET (with the debugger enabled)</p> ]]></content:encoded> </item> <item><title>By: den Ben</title><link>http://davybrion.com/blog/2008/10/exceptional-exception-handlingbehavior/comment-page-1/#comment-3382</link> <dc:creator>den Ben</dc:creator> <pubDate>Fri, 10 Oct 2008 07:44:05 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=501#comment-3382</guid> <description>&lt;cite&gt;&quot;but does resharper even have an impact on the debugger?&quot;&lt;/cite&gt;I believe it has to be able to mingle with it for at least some part.  How else would it be able to show that pretty little tests running progress?</description> <content:encoded><![CDATA[<p><cite>&#8220;but does resharper even have an impact on the debugger?&#8221;</cite></p><p>I believe it has to be able to mingle with it for at least some part.  How else would it be able to show that pretty little tests running progress?</p> ]]></content:encoded> </item> <item><title>By: Davy Brion</title><link>http://davybrion.com/blog/2008/10/exceptional-exception-handlingbehavior/comment-page-1/#comment-3379</link> <dc:creator>Davy Brion</dc:creator> <pubDate>Fri, 10 Oct 2008 06:38:18 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=501#comment-3379</guid> <description>@Alexglad we&#039;re not the only ones seeing this problem :)@Billinteresting... my setup is the following:
.NET 3.5 SP1
Visual Studio 2008 9.0.30729.1 SP
Resharper 4.1.933.3i&#039;ve experienced it on 2 pc&#039;s at work, both with the same configuration (the one listed above + windows vista business), and also on my home pc which has XP SP3So i guess the only difference (on first sight) is the resharper version... but does resharper even have an impact on the debugger?</description> <content:encoded><![CDATA[<p>@Alex</p><p>glad we&#8217;re not the only ones seeing this problem <img
src='http://d18sni7re4ly7f.cloudfront.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p>@Bill</p><p>interesting&#8230; my setup is the following:<br
/> .NET 3.5 SP1<br
/> Visual Studio 2008 9.0.30729.1 SP<br
/> Resharper 4.1.933.3</p><p>i&#8217;ve experienced it on 2 pc&#8217;s at work, both with the same configuration (the one listed above + windows vista business), and also on my home pc which has XP SP3</p><p>So i guess the only difference (on first sight) is the resharper version&#8230; but does resharper even have an impact on the debugger?</p> ]]></content:encoded> </item> <item><title>By: Alex Simkin</title><link>http://davybrion.com/blog/2008/10/exceptional-exception-handlingbehavior/comment-page-1/#comment-3368</link> <dc:creator>Alex Simkin</dc:creator> <pubDate>Thu, 09 Oct 2008 20:18:45 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=501#comment-3368</guid> <description>I confirm. When stepping through in the debugger, the exception is caught by:&quot;catch (Exception ex)&quot; and not by &quot;catch (T ex)&quot; even though type of ex is ExceptionWeirdness.MyException</description> <content:encoded><![CDATA[<p>I confirm. When stepping through in the debugger, the exception is caught by:</p><p>&#8220;catch (Exception ex)&#8221; and not by &#8220;catch (T ex)&#8221; even though type of ex is ExceptionWeirdness.MyException</p> ]]></content:encoded> </item> <item><title>By: Bill Pierce</title><link>http://davybrion.com/blog/2008/10/exceptional-exception-handlingbehavior/comment-page-1/#comment-3367</link> <dc:creator>Bill Pierce</dc:creator> <pubDate>Thu, 09 Oct 2008 19:09:54 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=501#comment-3367</guid> <description>I have:
.Net 3.5 SP1
VS 2008 9.0.30729.1 SP
ReSharper 3.1 C# Edition 3.1.584.3I copied and pasted your test exactly and do not experience the problem when running the test normally, with a debugger attached and no breakpoints, or by stepping through the test in the debugger.  Did not attempt debugging a console app.Perhaps try adding the serialization constructor to MyException.</description> <content:encoded><![CDATA[<p>I have:<br
/> .Net 3.5 SP1<br
/> VS 2008 9.0.30729.1 SP<br
/> ReSharper 3.1 C# Edition 3.1.584.3</p><p>I copied and pasted your test exactly and do not experience the problem when running the test normally, with a debugger attached and no breakpoints, or by stepping through the test in the debugger.  Did not attempt debugging a console app.</p><p>Perhaps try adding the serialization constructor to MyException.</p> ]]></content:encoded> </item> <item><title>By: Dew Drop - October 9, 2008 &#124; Alvin Ashcraft's Morning Dew</title><link>http://davybrion.com/blog/2008/10/exceptional-exception-handlingbehavior/comment-page-1/#comment-3360</link> <dc:creator>Dew Drop - October 9, 2008 &#124; Alvin Ashcraft's Morning Dew</dc:creator> <pubDate>Thu, 09 Oct 2008 13:58:29 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=501#comment-3360</guid> <description>[...] Exceptional Exception Handling Behavior (Davy Brion) [...]</description> <content:encoded><![CDATA[<p>[...] Exceptional Exception Handling Behavior (Davy Brion) [...]</p> ]]></content:encoded> </item> <item><title>By: Davy Brion</title><link>http://davybrion.com/blog/2008/10/exceptional-exception-handlingbehavior/comment-page-1/#comment-3359</link> <dc:creator>Davy Brion</dc:creator> <pubDate>Thu, 09 Oct 2008 13:33:06 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=501#comment-3359</guid> <description>that&#039;s good to know... i&#039;ve only tried it with visual studio 2008 sp1 so it might have been introduced by the service pack somehow</description> <content:encoded><![CDATA[<p>that&#8217;s good to know&#8230; i&#8217;ve only tried it with visual studio 2008 sp1 so it might have been introduced by the service pack somehow</p> ]]></content:encoded> </item> <item><title>By: Fabrice</title><link>http://davybrion.com/blog/2008/10/exceptional-exception-handlingbehavior/comment-page-1/#comment-3358</link> <dc:creator>Fabrice</dc:creator> <pubDate>Thu, 09 Oct 2008 13:31:31 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=501#comment-3358</guid> <description>Seems strange. It works well with .NET 2.0. I tried with VS 2005, and in both cases (debugging or not), it works as expected.</description> <content:encoded><![CDATA[<p>Seems strange. It works well with .NET 2.0. I tried with VS 2005, and in both cases (debugging or not), it works as expected.</p> ]]></content:encoded> </item> <item><title>By: Reflective Perspective - Chris Alcock &#187; The Morning Brew #197</title><link>http://davybrion.com/blog/2008/10/exceptional-exception-handlingbehavior/comment-page-1/#comment-3345</link> <dc:creator>Reflective Perspective - Chris Alcock &#187; The Morning Brew #197</dc:creator> <pubDate>Thu, 09 Oct 2008 07:20:01 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=501#comment-3345</guid> <description>[...] Exceptional Exception Handling Behavior - Davy Brion posts about some strange behaviour with exceptions and generics in and out of the debugger. Davy has posed this as a question, so the answer to the problem may be in the comments by the time you read this. [...]</description> <content:encoded><![CDATA[<p>[...] Exceptional Exception Handling Behavior &#8211; Davy Brion posts about some strange behaviour with exceptions and generics in and out of the debugger. Davy has posed this as a question, so the answer to the problem may be in the comments by the time you read this. [...]</p> ]]></content:encoded> </item> <item><title>By: Exceptional exception handling - KoenV</title><link>http://davybrion.com/blog/2008/10/exceptional-exception-handlingbehavior/comment-page-1/#comment-3325</link> <dc:creator>Exceptional exception handling - KoenV</dc:creator> <pubDate>Wed, 08 Oct 2008 18:04:29 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=501#comment-3325</guid> <description>[...] colleague Davy beat me to post this problem we had today at work, so I&#039;m gonna be lazy and link to him (and steal his title).Btw yesterday we applied this &quot;solution&quot; to one of our biggest projects and [...]</description> <content:encoded><![CDATA[<p>[...] colleague Davy beat me to post this problem we had today at work, so I&#8217;m gonna be lazy and link to him (and steal his title).Btw yesterday we applied this &#8220;solution&#8221; to one of our biggest projects and [...]</p> ]]></content:encoded> </item> <item><title>By: Davy Brion</title><link>http://davybrion.com/blog/2008/10/exceptional-exception-handlingbehavior/comment-page-1/#comment-3324</link> <dc:creator>Davy Brion</dc:creator> <pubDate>Wed, 08 Oct 2008 17:51:14 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=501#comment-3324</guid> <description>don&#039;t think that makes a difference... the really weird thing is that when the debugger is not attached, the exception is caught by the catch (T exception) handler. When it is attached, the catch (T exception) handler is just not entered.Yet, when you put in the catch (Exception exception) handler, and cast the exception to T, it does work when the debugger is attached.it&#039;s as if catching exceptions just behaves differently when a debugger is attached... i tried it on 3 different PC&#039;s before i believed it :)</description> <content:encoded><![CDATA[<p>don&#8217;t think that makes a difference&#8230; the really weird thing is that when the debugger is not attached, the exception is caught by the catch (T exception) handler. When it is attached, the catch (T exception) handler is just not entered.</p><p>Yet, when you put in the catch (Exception exception) handler, and cast the exception to T, it does work when the debugger is attached.</p><p>it&#8217;s as if catching exceptions just behaves differently when a debugger is attached&#8230; i tried it on 3 different PC&#8217;s before i believed it <img
src='http://d18sni7re4ly7f.cloudfront.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: JacobM</title><link>http://davybrion.com/blog/2008/10/exceptional-exception-handlingbehavior/comment-page-1/#comment-3323</link> <dc:creator>JacobM</dc:creator> <pubDate>Wed, 08 Oct 2008 17:39:52 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=501#comment-3323</guid> <description>You may want to check the &quot;Break on exceptions&quot; settings in the VS debugger -- you can certainly set it to break on any exception, even if it&#039;s handled.  Not what you want in this case.</description> <content:encoded><![CDATA[<p>You may want to check the &#8220;Break on exceptions&#8221; settings in the VS debugger &#8212; you can certainly set it to break on any exception, even if it&#8217;s handled.  Not what you want in this case.</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 24/24 queries in 0.004 seconds using disk: basic
Object Caching 661/661 objects using disk: basic
Content Delivery Network via Amazon Web Services: CloudFront: d18sni7re4ly7f.cloudfront.net

Served from: davybrion.com @ 2012-05-21 13:22:50 -->
