PDA

Click to See Complete Forum and Search --> : What is the difference between System exceptions and Application exceptions?


ali0482
Aug 18th, 2010, 10:47 AM
.NET INTERVIEW QUESTIONS - What is the difference between System exceptions and Application exceptions?...

jmcilhinney
Aug 25th, 2010, 01:36 AM
It would be a little more logical to post .NET questions in one of the .NET forums rather than the COM & ActiveX forum, which is specifically not .NET.

You could say that system exceptions are those raised by the system and application exceptions are those raised by the application but there's a more specific meaning in .NET.

The Exception class is the base class for all exceptions and the SystemException and ApplicationException classes both inherit it. Neither provides any extra functionality, but are rather just supposed to act as base classes. All exceptions defined in the .NET Framework are derived from SystemException and the intent was that everyone else would derive their exceptions from ApplicationException.

It was decided that this didn't actually serve a useful purpose because, if an existing exception class provided functionality that an application developer needs, they will use that directly or as a base class rather than duplicating functionality by inheriting ApplicationException. It is now recommended to inherit Exception directly if you aren't inheriting some other derived exception class and ApplicationException is basically ignored.

Hack
Aug 25th, 2010, 05:46 AM
Moved From .Com/ActiveX