Brad Abrams has a good article out there showing a list of all the .net exceptions you can throw from your code.
There are some exceptions that are not shown here, for example ConfigurationException, but this is a good starting point.
From Brad's article:
+--System.Object
|
+--System.Exception
+--System.SystemException
+--System.ArgumentException
| |
| +--System.ArgumentNullException
| +--System.ArgumentOutOfRangeException
| +--System.DuplicateWaitObjectException
+--System.ArithmeticException
| +--System.DivideByZeroException
| +--System.OverflowException
| +--System.NotFiniteNumberException
+--System.ArrayTypeMismatchException
+--System.ExecutionEngineException
+--System.FormatException
+--System.IndexOutOfRangeException
+--System.InvalidCastException
+--System.InvalidOperationException
| +--System.ObjectDisposedException
+--System.InvalidProgramException
+--System.IO.IOException
| +--System.IO.DirectoryNotFoundException
| +--System.IO.EndOfStreamException
| +--System.IO.FileLoadException
| +--System.IO.FileNotFoundException
| +--System.IO.PathTooLongException
+--System.NotImplementedException
+--System.NotSupportedException
+--System.NullReferenceException
+--System.OutOfMemoryException
+--System.RankException
+--System.Security.SecurityException
+--System.Security.VerificationException
+--System.StackOverflowException
+--System.Threading.SynchronizationLockException
+--System.Threading.ThreadAbortException
+--System.Threading.ThreadStateException
+--System.TypeInitializationException
+--System.UnauthorizedAccessException
Jeff Atwood put up another article where he uses a little console app to find all classes named "*Exception".
Here is his list:
System.AppDomainUnloadedExceptionSystem.ApplicationExceptionSystem.ArgumentExceptionSystem.ArgumentNullExceptionSystem.ArgumentOutOfRangeExceptionSystem.ArithmeticExceptionSystem.ArrayTypeMismatchExceptionSystem.BadImageFormatExceptionSystem.CannotUnloadAppDomainExceptionSystem.ComponentModel.Design.CheckoutExceptionSystem.ComponentModel.Design.Serialization.CodeDomSerializerExceptionSystem.ComponentModel.InvalidEnumArgumentExceptionSystem.ComponentModel.LicenseExceptionSystem.ComponentModel.WarningExceptionSystem.ComponentModel.Win32ExceptionSystem.Configuration.ConfigurationExceptionSystem.ContextMarshalExceptionSystem.Data.ConstraintExceptionSystem.Data.DataExceptionSystem.Data.DBConcurrencyExceptionSystem.Data.DeletedRowInaccessibleExceptionSystem.Data.DuplicateNameExceptionSystem.Data.EvaluateExceptionSystem.Data.ExprExceptionSystem.Data.InRowChangingEventExceptionSystem.Data.InvalidConstraintExceptionSystem.Data.InvalidExpressionExceptionSystem.Data.MissingPrimaryKeyExceptionSystem.Data.NoNullAllowedExceptionSystem.Data.Odbc.OdbcExceptionSystem.Data.OleDb.OleDbExceptionSystem.Data.ReadOnlyExceptionSystem.Data.RowNotInTableExceptionSystem.Data.SqlClient._ValueExceptionSystem.Data.SqlClient.SqlExceptionSystem.Data.SqlTypes.SqlNullValueExceptionSystem.Data.SqlTypes.SqlTruncateExceptionSystem.Data.SqlTypes.SqlTypeExceptionSystem.Data.StrongTypingExceptionSystem.Data.SyntaxErrorExceptionSystem.Data.TypedDataSetGeneratorExceptionSystem.Data.VersionNotFoundExceptionSystem.DivideByZeroExceptionSystem.DllNotFoundExceptionSystem.Drawing.Printing.InvalidPrinterExceptionSystem.DuplicateWaitObjectExceptionSystem.EntryPointNotFoundExceptionSystem.ExceptionSystem.ExecutionEngineExceptionSystem.FieldAccessExceptionSystem.FormatExceptionSystem.IndexOutOfRangeExceptionSystem.InvalidCastExceptionSystem.InvalidOperationExceptionSystem.InvalidProgramExceptionSystem.IO.DirectoryNotFoundExceptionSystem.IO.EndOfStreamExceptionSystem.IO.FileLoadExceptionSystem.IO.FileNotFoundExceptionSystem.IO.InternalBufferOverflowExceptionSystem.IO.IOExceptionSystem.IO.IsolatedStorage.IsolatedStorageExceptionSystem.IO.PathTooLongExceptionSystem.Management.ManagementExceptionSystem.MemberAccessExceptionSystem.Messaging.MessageQueueExceptionSystem.MethodAccessExceptionSystem.MissingFieldExceptionSystem.MissingMemberExceptionSystem.MissingMethodExceptionSystem.MulticastNotSupportedExceptionSystem.Net.CookieExceptionSystem.Net.ProtocolViolationExceptionSystem.Net.Sockets.SocketExceptionSystem.Net.WebExceptionSystem.NotFiniteNumberExceptionSystem.NotImplementedExceptionSystem.NotSupportedExceptionSystem.NullReferenceExceptionSystem.ObjectDisposedExceptionSystem.OutOfMemoryExceptionSystem.OverflowExceptionSystem.PlatformNotSupportedExceptionSystem.RankExceptionSystem.Reflection.AmbiguousMatchExceptionSystem.Reflection.CustomAttributeFormatExceptionSystem.Reflection.InvalidFilterCriteriaExceptionSystem.Reflection.ReflectionTypeLoadExceptionSystem.Reflection.TargetExceptionSystem.Reflection.TargetInvocationExceptionSystem.Reflection.TargetParameterCountExceptionSystem.Resources.MissingManifestResourceExceptionSystem.Runtime.InteropServices.COMExceptionSystem.Runtime.InteropServices.ExternalExceptionSystem.Runtime.InteropServices.InvalidComObjectExceptionSystem.Runtime.InteropServices.InvalidOleVariantTypeExceptionSystem.Runtime.InteropServices.MarshalDirectiveExceptionSystem.Runtime.InteropServices.SafeArrayRankMismatchExceptionSystem.Runtime.InteropServices.SafeArrayTypeMismatchExceptionSystem.Runtime.InteropServices.SEHExceptionSystem.Runtime.Remoting.MetadataServices.SUDSGeneratorExceptionSystem.Runtime.Remoting.MetadataServices.SUDSParserExceptionSystem.Runtime.Remoting.RemotingExceptionSystem.Runtime.Remoting.RemotingTimeoutExceptionSystem.Runtime.Remoting.ServerExceptionSystem.Runtime.Serialization.SerializationExceptionSystem.Security.Cryptography.CryptographicExceptionSystem.Security.Cryptography.CryptographicUnexpectedOperationExceptionSystem.Security.Policy.PolicyExceptionSystem.Security.SecurityExceptionSystem.Security.VerificationExceptionSystem.Security.XmlSyntaxExceptionSystem.ServiceProcess.TimeoutExceptionSystem.StackOverflowExceptionSystem.SystemExceptionSystem.Threading.SynchronizationLockExceptionSystem.Threading.ThreadAbortExceptionSystem.Threading.ThreadInterruptedExceptionSystem.Threading.ThreadStateExceptionSystem.Threading.ThreadStopExceptionSystem.TypeInitializationExceptionSystem.TypeLoadExceptionSystem.TypeUnloadedExceptionSystem.UnauthorizedAccessExceptionSystem.UriFormatExceptionSystem.Web.HttpApplication+CancelModuleExceptionSystem.Web.HttpCompileExceptionSystem.Web.HttpExceptionSystem.Web.HttpParseExceptionSystem.Web.HttpRequestValidationExceptionSystem.Web.HttpUnhandledExceptionSystem.Web.Services.Discovery.InvalidContentTypeExceptionSystem.Web.Services.Discovery.InvalidDocumentContentsExceptionSystem.Web.Services.Protocols.SoapExceptionSystem.Web.Services.Protocols.SoapHeaderExceptionSystem.Windows.Forms.AxHost+InvalidActiveXStateExceptionSystem.Xml.Schema.XmlSchemaExceptionSystem.Xml.XmlExceptionSystem.Xml.XPath.XPathExceptionSystem.Xml.Xsl.XsltCompileExceptionThe code used to create this list (.net 1.1) is: Sub Main() ReflectionSearch(".*exception$") Console.ReadLine() End Sub Sub ReflectionSearch(ByVal strPattern As String) Dim a As Reflection.Assembly Dim m As Reflection.Module Dim t As Type Dim al As New ArrayList Dim sl As New SortedList Dim strAssemblyName As String For Each strAssemblyName In DefaultAssemblyList() a = Reflection.Assembly.Load(strAssemblyName) For Each m In a.GetModules For Each t In m.GetTypes al.Add(t) Dim strFullName As String = t.FullName If Regex.IsMatch(strFullName, strPattern, RegexOptions.IgnoreCase) Then sl.Add(strFullName, Nothing) End If Next Next Next Dim de As DictionaryEntry For Each de In sl Console.WriteLine(de.Key) Next Console.WriteLine(sl.Count.ToString & " matches for " & strPattern) End Sub Function DefaultAssemblyList() as ArrayList Dim al As New ArrayList With al .Add("mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089") .Add("System.Data, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089") .Add("System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089") .Add("System.Runtime.Remoting, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089") .Add("System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089") .Add("System.Xml, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089") .Add("System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") .Add("System.DirectoryServices, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") .Add("System.Drawing.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") .Add("System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") .Add("System.Messaging, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") .Add("System.Runtime.Serialization.Formatters.Soap, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") .Add("System.Security, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") .Add("System.ServiceProcess, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") .Add("System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") .Add("System.Web.Services, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") .Add("System.Management, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") End With Return al End FunctionSystem.Xml.Xsl.XsltException
Remember Me
Powered by: newtelligence dasBlog 1.9.6264.0
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
E-mail
Theme design by Jelle Druyts