NOTE: This member is now obsolete. Use other exception type instead.

This is our custom exception.

Namespace: SampleClassLibrary
Assembly: SampleClassLibrary (in SampleClassLibrary.dll)

<Obsolete("Use other exception type instead.")> _ 
Public Class NestedException 
Inherits Exception
This language is not supported or no code example is available.
[Obsolete("Use other exception type instead.")] 
public class NestedException : Exception
This language is not supported or no code example is available.
[<Obsolete("Use other exception type instead.")>] 
type NestedException = class  
inherit Exception 
end
This language is not supported or no code example is available.
[Obsolete("Use other exception type instead.")] 
public ref class NestedException : public Exception^
This language is not supported or no code example is available.
public  
Obsolete("Use other exception type instead.") 
class NestedException 
extends Exception
This language is not supported or no code example is available.
Name Description
Public property Data Gets a collection of key/value pairs that provide additional user-defined information about the exception. (inherited from Exception).
Public property HResult Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception. (inherited from Exception).
Public property HelpLink Gets or sets a link to the help file associated with this exception. (inherited from Exception).
Public property InnerException Gets the Exception instance that caused the current exception. (inherited from Exception).
Public property Message Gets a message that describes the current exception. (inherited from Exception).
Public property Source Gets or sets the name of the application or the object that causes the error. (inherited from Exception).
Public property StackTrace Gets a string representation of the immediate frames on the call stack. (inherited from Exception).
Public property TargetSite Gets the method that throws the current exception. (inherited from Exception).
Top
Name Description
Public method Equals(Object) Determines whether the specified object is equal to the current object. (inherited from Object).
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (inherited from Object).
Public method GetBaseException When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions. (inherited from Exception).
Public method GetHashCode Serves as the default hash function. (inherited from Object).
Public method GetObjectData(SerializationInfo, StreamingContext) When overridden in a derived class, sets the SerializationInfo with information about the exception. (inherited from Exception).
Public method GetType Gets the runtime type of the current instance. (inherited from Exception).
Protected method MemberwiseClone Creates a shallow copy of the current Object. (inherited from Object).
Public method ToString Creates and returns a string representation of the current exception. (inherited from Exception).
Top
Name Description
Protected event SerializeObjectState Occurs when an exception is serialized to create an exception state object that contains serialized data about the exception. (inherited from Exception).
Top
This is also an example of a nested class and ObsoleteAttribute.
SampleClassLibrary.MainClass.NestedException

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Core

Supported in: 1.0, 1.1, 2.0

.NET Standard

Supported in: 2.0

Xamarin.Android

Supported in: 7.1

Portable Class Library

Supported in: Portable Class Library