AuthenticationException Constructors

Definition

Initializes a new instance of the AuthenticationException class.

Overloads

AuthenticationException()

Initializes a new instance of the AuthenticationException class with no message.

AuthenticationException(String)

Initializes a new instance of the AuthenticationException class with the specified message.

AuthenticationException(SerializationInfo, StreamingContext)
Obsolete.

Initializes a new instance of the AuthenticationException class from the specified instances of the SerializationInfo and StreamingContext classes.

AuthenticationException(String, Exception)

Initializes a new instance of the AuthenticationException class with the specified message and inner exception.

AuthenticationException()

Source:
AuthenticationException.cs
Source:
AuthenticationException.cs
Source:
AuthenticationException.cs

Initializes a new instance of the AuthenticationException class with no message.

C#
public AuthenticationException();

Remarks

This constructor does nothing.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

AuthenticationException(String)

Source:
AuthenticationException.cs
Source:
AuthenticationException.cs
Source:
AuthenticationException.cs

Initializes a new instance of the AuthenticationException class with the specified message.

C#
public AuthenticationException(string? message);
C#
public AuthenticationException(string message);

Parameters

message
String

A String that describes the authentication failure.

Remarks

This constructor initializes the Message property with the text in the message parameter. The InnerException property is set to null.

See also

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

AuthenticationException(SerializationInfo, StreamingContext)

Source:
AuthenticationException.cs
Source:
AuthenticationException.cs
Source:
AuthenticationException.cs

Caution

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

Initializes a new instance of the AuthenticationException class from the specified instances of the SerializationInfo and StreamingContext classes.

C#
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
protected AuthenticationException(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
C#
protected AuthenticationException(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);

Parameters

serializationInfo
SerializationInfo

A SerializationInfo instance that contains the information required to deserialize the new AuthenticationException instance.

streamingContext
StreamingContext

A StreamingContext instance.

Attributes

See also

Applies to

.NET 10 and other versions
Product Versions (Obsolete)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7 (8, 9, 10)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

AuthenticationException(String, Exception)

Source:
AuthenticationException.cs
Source:
AuthenticationException.cs
Source:
AuthenticationException.cs

Initializes a new instance of the AuthenticationException class with the specified message and inner exception.

C#
public AuthenticationException(string? message, Exception? innerException);
C#
public AuthenticationException(string message, Exception innerException);

Parameters

message
String

A String that describes the authentication failure.

innerException
Exception

The Exception that is the cause of the current exception.

Remarks

This constructor initializes the Message property with the text in the message parameter and initializes the InnerException property with the innerException parameter value.

See also

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1