<?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>ApplicationException considered useless</title><link>http://blogs.msdn.com/kcwalina/archive/2006/06/23/644822.aspx</link><description>We have a guideline that bans using the ApplicationException. Here is the related excerpt from the Framework Design Guidelines: ý Do not throw or derive from System.ApplicationException. JEFFREY RICHTER: System.ApplicationException is a class that should</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: ApplicationException considered useless</title><link>http://blogs.msdn.com/kcwalina/archive/2006/06/23/644822.aspx#644872</link><pubDate>Sat, 24 Jun 2006 01:15:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:644872</guid><dc:creator>Haacked</dc:creator><description>I might consider removing any catch blocks like so:&lt;br&gt;&lt;br&gt; &amp;nbsp; &amp;nbsp;catch(ApplicationException)&lt;br&gt;&lt;br&gt;since it's almost (though not quite) the equivalent to &lt;br&gt;&lt;br&gt; &amp;nbsp; &amp;nbsp;catch(Exception)&lt;br&gt;&lt;br&gt;If you have a lot of classes that inherit from ApplicationException. &amp;nbsp;In this case it could be harmful.</description></item><item><title>re: ApplicationException considered useless</title><link>http://blogs.msdn.com/kcwalina/archive/2006/06/23/644822.aspx#646011</link><pubDate>Sun, 25 Jun 2006 00:04:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:646011</guid><dc:creator>TAG</dc:creator><description>It's useless becouse Microsoft has not added any additional functionality inside it over plain Exception. &lt;br&gt;&lt;br&gt;For example such a common feature as retriving error message text from resources. &lt;br&gt;On throw store only resource ID - and format them only then requested. &lt;br&gt;</description></item><item><title>re: ApplicationException considered useless</title><link>http://blogs.msdn.com/kcwalina/archive/2006/06/23/644822.aspx#646601</link><pubDate>Sun, 25 Jun 2006 17:00:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:646601</guid><dc:creator>Kalpesh</dc:creator><description>In that case, what I should use &amp;amp; throw for exceptions that are due to the Application?&lt;br&gt;</description></item><item><title>to derive or not to derive from ApplicationException</title><link>http://blogs.msdn.com/kcwalina/archive/2006/06/23/644822.aspx#648467</link><pubDate>Tue, 27 Jun 2006 16:15:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:648467</guid><dc:creator>jokiz's blog</dc:creator><description>remember the rule to always derive custom exceptions from ApplicationException?&amp;amp;amp;nbsp; so you thought...</description></item><item><title>re: ApplicationException considered useless</title><link>http://blogs.msdn.com/kcwalina/archive/2006/06/23/644822.aspx#648857</link><pubDate>Tue, 27 Jun 2006 22:03:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:648857</guid><dc:creator>Lance</dc:creator><description>What about the problem of HResult code associated with the ApplicationException vs Exception with .NET components loaded from a COM+ environment?&lt;br&gt;&lt;br&gt;Due to the mixed message about ApplicationException, I have seen a few rare cases where an exception from a CCW .NET plugin hosted from a COM+ application marshals-up as COR_E_EXCEPTION instead of COR_E_APPLICATION.&lt;br&gt;&lt;br&gt;&lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconHRESULTsExceptions.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconHRESULTsExceptions.asp&lt;/a&gt;&lt;br&gt;&lt;br&gt;Granted, this isnt a common scenario, but it can be problematic for those of us who have run into this.&lt;br&gt;&lt;br&gt;Thoughts?&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</description></item><item><title>re: ApplicationException considered useless</title><link>http://blogs.msdn.com/kcwalina/archive/2006/06/23/644822.aspx#655653</link><pubDate>Tue, 04 Jul 2006 03:36:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:655653</guid><dc:creator>TimB</dc:creator><description>I agree with Kalpesh,If we should not use ApplicationException or Custom Exception derive from ApplicationException then how should we throw exceptions. I have also read that throwing System.Exception is a very expensive operation and there is a lot of OS/platform specific information written,so if I have 3+ tier application where each layer bubbles the exception what should we do??</description></item><item><title>Choosing the Right Type of Exception to Throw</title><link>http://blogs.msdn.com/kcwalina/archive/2006/06/23/644822.aspx#657269</link><pubDate>Thu, 06 Jul 2006 01:17:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:657269</guid><dc:creator>Krzysztof Cwalina</dc:creator><description>My last post about the ApplicationException resulted in some questions along the lines of “so, if not...</description></item><item><title>re: ApplicationException considered useless</title><link>http://blogs.msdn.com/kcwalina/archive/2006/06/23/644822.aspx#657272</link><pubDate>Thu, 06 Jul 2006 01:19:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:657272</guid><dc:creator>kcwalina</dc:creator><description>Kalpesh and Tim, thanks for asking. I answered your question in a new post at &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/kcwalina/archive/2006/07/05/657268.aspx"&gt;http://blogs.msdn.com/kcwalina/archive/2006/07/05/657268.aspx&lt;/a&gt;&lt;br&gt;</description></item><item><title>re: ApplicationException considered useless</title><link>http://blogs.msdn.com/kcwalina/archive/2006/06/23/644822.aspx#798769</link><pubDate>Sat, 07 Oct 2006 01:56:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:798769</guid><dc:creator>theking2</dc:creator><description>A user defined Exception thrown from an COM+ object results in the following stack. Throwing an ApplicationException does work. Hence the ApplicationException should be marked as final.

System.Runtime.Serialization.SerializationException: The constructor to deserialize an object of type UnitedMobile.Provisioning.eServGlobal.PI.PIException was not found.
   at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)
   at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder)
   at System.Runtime.Serialization.ObjectManager.DoFixups()
   at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage methodCallMessage)
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, IMethodCallMessage methodCallMessage)
   at System.EnterpriseServices.ComponentSerializer.UnmarshalReturnMessageFromBuffer(Byte[] b, IMethodCallMessage msg)
   at System.EnterpriseServices.ComponentServices.ConvertToReturnMessage(String s, IMessage mcMsg)
   at System.EnterpriseServices.RemoteServicedComponentProxy.Invoke(IMessage reqMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)

</description></item><item><title>James Manning  &amp;raquo; Blog Archive   &amp;raquo; Python gets right what Java already has, and .NET still hasn&amp;#8217;t</title><link>http://blogs.msdn.com/kcwalina/archive/2006/06/23/644822.aspx#886167</link><pubDate>Sat, 28 Oct 2006 04:13:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:886167</guid><dc:creator>James Manning  » Blog Archive   » Python gets right what Java already has, and .NET still hasn’t</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://blog.sublogic.com/2006/10/python-gets-right-what-java-already-has-and-net-still-hasnt/"&gt;http://blog.sublogic.com/2006/10/python-gets-right-what-java-already-has-and-net-still-hasnt/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>FAQ: Why do some sources recommend extending ApplicationException while FxCop does not? [Michael Fanning, David Kean]</title><link>http://blogs.msdn.com/kcwalina/archive/2006/06/23/644822.aspx#1561586</link><pubDate>Wed, 31 Jan 2007 08:04:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1561586</guid><dc:creator>The Visual Studio Code Analysis Team Blog</dc:creator><description>&lt;p&gt;TypesShouldNotExtendCertainBaseTypes fires on types that derive from ApplicationException and DoNotRaiseReservedExceptionTypes&lt;/p&gt;
</description></item><item><title>Goodbye ApplicationException!</title><link>http://blogs.msdn.com/kcwalina/archive/2006/06/23/644822.aspx#2648767</link><pubDate>Tue, 15 May 2007 15:42:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2648767</guid><dc:creator>knom's developer corner</dc:creator><description>&lt;p&gt;While researching on Visual Studio Static Code Analysis topics I come over blog posts by Brad Abrams&lt;/p&gt;
</description></item><item><title>ApplicationException - приходить і уходить....</title><link>http://blogs.msdn.com/kcwalina/archive/2006/06/23/644822.aspx#2674618</link><pubDate>Wed, 16 May 2007 18:31:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2674618</guid><dc:creator>Mike Chaliy's Blog</dc:creator><description>&lt;p&gt;Помашіть ручкою ApplicationException в вашому коді. Тепер нам рекомендують кастом виключення наслідувати&lt;/p&gt;
</description></item><item><title>Born 2 Code .NET  &amp;raquo; Blog Archive   &amp;raquo; Don&amp;#8217;t throw an ApplicationException, not any more!</title><link>http://blogs.msdn.com/kcwalina/archive/2006/06/23/644822.aspx#2731394</link><pubDate>Sat, 19 May 2007 14:31:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2731394</guid><dc:creator>Born 2 Code .NET  » Blog Archive   » Don’t throw an ApplicationException, not any more!</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://born2code.net/?p=95"&gt;http://born2code.net/?p=95&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>Catch ApplicationExceptions? I was wrong!</title><link>http://blogs.msdn.com/kcwalina/archive/2006/06/23/644822.aspx#3309029</link><pubDate>Fri, 15 Jun 2007 11:15:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3309029</guid><dc:creator>Tech Blogs by Dominic Zukiewicz</dc:creator><description>&lt;p&gt;Catch ApplicationExceptions? I was wrong!&lt;/p&gt;
</description></item><item><title>re: ApplicationException considered useless</title><link>http://blogs.msdn.com/kcwalina/archive/2006/06/23/644822.aspx#3578911</link><pubDate>Thu, 28 Jun 2007 11:23:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3578911</guid><dc:creator>Edwin</dc:creator><description>&lt;p&gt;I was wondering how to handle business-rules violation exceptions. &lt;/p&gt;
&lt;p&gt;Like you want to print an invoice, but the street address isn't filled in. In that case I would want, for example, to throw an InvoiceNotCompleted exception. &lt;/p&gt;
&lt;p&gt;I thought it was the right way to derive such exception from ApplicationException... But it seems not. So what should I use? For for example logging purpuses it would be nice if all business-exception would derive from a common CLR exception, specifically made for this use, without creating a custom exception, so the logging module can be reused.&lt;/p&gt;
&lt;p&gt;Any ideas on this?&lt;/p&gt;</description></item><item><title>re: ApplicationException considered useless</title><link>http://blogs.msdn.com/kcwalina/archive/2006/06/23/644822.aspx#3607096</link><pubDate>Fri, 29 Jun 2007 19:48:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3607096</guid><dc:creator>kcwalina</dc:creator><description>&lt;p&gt;Edwin, you should just inherit from Exception.&lt;/p&gt;
</description></item><item><title>Kalivo.com - ApplicationException vs Exception in .NET</title><link>http://blogs.msdn.com/kcwalina/archive/2006/06/23/644822.aspx#8769811</link><pubDate>Thu, 24 Jul 2008 21:43:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8769811</guid><dc:creator>Kalivo.com - ApplicationException vs Exception in .NET</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.kalivo.com/convs/show/1535-applicationexception-vs-exception-in-net"&gt;http://www.kalivo.com/convs/show/1535-applicationexception-vs-exception-in-net&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: ApplicationException considered useless</title><link>http://blogs.msdn.com/kcwalina/archive/2006/06/23/644822.aspx#9321122</link><pubDate>Thu, 15 Jan 2009 19:34:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9321122</guid><dc:creator>Jim</dc:creator><description>&lt;p&gt;Does anyone know if Microsoft is planning to drop ApplicationException from the .NET Framework? &amp;nbsp;&lt;/p&gt;</description></item><item><title>creating a custom exception | keyongtech</title><link>http://blogs.msdn.com/kcwalina/archive/2006/06/23/644822.aspx#9364776</link><pubDate>Thu, 22 Jan 2009 11:23:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9364776</guid><dc:creator>creating a custom exception | keyongtech</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.keyongtech.com/664993-creating-a-custom-exception"&gt;http://www.keyongtech.com/664993-creating-a-custom-exception&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: ApplicationException considered useless</title><link>http://blogs.msdn.com/kcwalina/archive/2006/06/23/644822.aspx#9413975</link><pubDate>Thu, 12 Feb 2009 06:25:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9413975</guid><dc:creator>WangJunwei</dc:creator><description>&lt;p&gt;Jim, I think it won't plan to drop ApplicationException from Framework since dozens of legacy codes exists currently.&lt;/p&gt;</description></item><item><title>re: ApplicationException considered useless</title><link>http://blogs.msdn.com/kcwalina/archive/2006/06/23/644822.aspx#9543926</link><pubDate>Fri, 10 Apr 2009 23:01:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9543926</guid><dc:creator>Marc Jacobi</dc:creator><description>&lt;p&gt;Seems to me that the whole notion of being able to determine if its an application exception is a non-issue.&lt;/p&gt;
&lt;p&gt;To me, only one thing is important: are you allowed to catch it? I know this sound strange, but consider the 'normal' way of how exceptions are handled. catch(Exception e), right? I know you are not supposed to do it, but everybody does - including me - because its easy. This also catches a lot of exceptions that shouldn't be caught (who is going to recover from an AccessViolationException or an ExecutionEngineException!?). So for 'user' code I would like to be able to do something like catch(NonCriticalException e) and *know* that I will not catch anything that should terminate the process.&lt;/p&gt;
&lt;p&gt;Obviously Microsoft totally screwed up on the exception hierarchy in the .NET framework. Unless they rebase these exceptions, all is lost...&lt;/p&gt;
&lt;p&gt;But its a good point to think about for your own application exceptions.&lt;/p&gt;</description></item></channel></rss>