TimeoutException Constructors

Definition

Initializes a new instance of the TimeoutException class.

Overloads

TimeoutException()

Initializes a new instance of the TimeoutException class with no message text.

TimeoutException(String)

Initializes a new instance of the TimeoutException class with the specified message text.

TimeoutException(SerializationInfo, StreamingContext)
Obsolete.

Initializes a new instance of the TimeoutException class with the specified serialization information and context.

TimeoutException(String, Exception)

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

TimeoutException()

Source:
TimeoutException.cs
Source:
TimeoutException.cs
Source:
TimeoutException.cs

Initializes a new instance of the TimeoutException class with no message text.

C#
public TimeoutException();

Applies to

.NET 10 (package-provided) 和其他版本
产品 版本
.NET Core 1.0, Core 1.1, 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 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 (package-provided)

TimeoutException(String)

Source:
TimeoutException.cs
Source:
TimeoutException.cs
Source:
TimeoutException.cs

Initializes a new instance of the TimeoutException class with the specified message text.

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

Parameters

message
String

Text that describes the type or source of the exception.

Applies to

.NET 10 (package-provided) 和其他版本
产品 版本
.NET Core 1.0, Core 1.1, 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 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 (package-provided)

TimeoutException(SerializationInfo, StreamingContext)

Source:
TimeoutException.cs
Source:
TimeoutException.cs
Source:
TimeoutException.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 TimeoutException class with the specified serialization information and context.

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 TimeoutException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
C#
protected TimeoutException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);

Parameters

info
SerializationInfo

The SerializationInfo that holds the serialized object data about the exception being thrown.

context
StreamingContext

The StreamingContext that contains contextual information about the source or destination.

Attributes

Exceptions

The info parameter is null.

The class name is null or HResult is zero (0).

Applies to

.NET 10 (package-provided) 和其他版本
产品 版本 (已过时)
.NET (8 (package-provided), 9 (package-provided), 10 (package-provided))
.NET Framework 1.1, 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 (package-provided)

TimeoutException(String, Exception)

Source:
TimeoutException.cs
Source:
TimeoutException.cs
Source:
TimeoutException.cs

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

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

Parameters

message
String

Text that describes the type or source of the exception.

innerException
Exception

The exception that caused the current exception.

See also

Applies to

.NET 10 (package-provided) 和其他版本
产品 版本
.NET Core 1.0, Core 1.1, 8 (package-provided), 9 (package-provided), 10 (package-provided)
.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 (package-provided)