Standard Exception Hierarchy in .NET Core
The official Microsoft documentation is not very good at giving an overview of the available exception types in .net Core, so this is my attempt at doing so. In other words, this list is far from exhaustive; instead, I try to list the exception types that I find generally useful.
System.ExceptionSystem.ApplicationException11 Should not be used in client code (indicates something is wrong with the code on the source level), but I have seen it used.System.Net.Http.HttpRequestExceptionSystem.SystemExceptionSystem.ArgumentExceptionSystem.ArgumentNullExceptionSystem.ArgumentOutOfRangeException
System.FormatException22 Parser failure.System.IndexOutOfRangeExceptionSystem.InvalidOperationException33 Under the current configuration, this operation cannot be performed.System.NotImplementedExceptionSystem.NotSupportedException44 The operation is not supported and not meant to be supported either, e.g. modifying a read-only collection.System.PlatformNotSupportedException55 The operation is not supported due to the platform the program runs on.
System.NullReferenceException66 Prefer validating early and throwingSystem.ArgumentNullException.System.TimeoutExceptionSystem.IO.InvalidDataException77 Raw binary data in an i/o stream did not conform to expectations.System.IO.IOExceptionSystem.IO.DirectoryNotFoundExceptionSystem.IO.EndOfStreamExceptionSystem.IO.FileNotFoundException
System.Security.SecurityException