In general, you should avoid deriving user-defined exceptions from the Exception base class. Instead, you should derive custom exceptions from a derived class of System.Exception (usually System.ApplicationException or System.SystemException).
Both System.ApplicationException and System.SystemException extend System.Exception without adding new functionality. Use these base classes instead of System.Exception to differentiate between exceptions defined by applications and exceptions defined by the system.
' VB
Public Class EmployeeNotFoundException
Inherits System.Exception
' Code here
End Class
// C#
public class EmployeeNotFoundException : ApplicationException
{
// Code here
}
' VB
Public Class EmployeeNotFoundException
Inherits System.ApplicationException
' Code here
End Class
// C#
public class EmployeeNotFoundException : ApplicationException
{
// Code here
}