ThrowHelper.ThrowInvalidOperationException Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
ThrowInvalidOperationException(String)
- Source:
- ThrowHelper.cs
- Source:
- ThrowHelper.cs
Throws a new InvalidOperationException.
public static void ThrowInvalidOperationException(string? message);
static member ThrowInvalidOperationException : string -> unit
Public Shared Sub ThrowInvalidOperationException (message As String)
Parameters
- message
- String
The message to include in the exception.
Exceptions
Thrown with the specified parameter.
Applies to
ThrowInvalidOperationException(String, Exception)
- Source:
- ThrowHelper.cs
- Source:
- ThrowHelper.cs
Throws a new InvalidOperationException.
public static void ThrowInvalidOperationException(string? message, Exception? innerException);
static member ThrowInvalidOperationException : string * Exception -> unit
Public Shared Sub ThrowInvalidOperationException (message As String, innerException As Exception)
Parameters
- message
- String
The message to include in the exception.
Exceptions
Thrown with the specified parameter.
Applies to
ThrowInvalidOperationException()
- Source:
- ThrowHelper.cs
- Source:
- ThrowHelper.cs
Throws a new InvalidOperationException.
public static void ThrowInvalidOperationException();
static member ThrowInvalidOperationException : unit -> unit
Public Shared Sub ThrowInvalidOperationException ()
Exceptions
Thrown with no parameters.
Applies to
ThrowInvalidOperationException<T>()
- Source:
- ThrowHelper.Generic.cs
- Source:
- ThrowHelper.Generic.cs
Throws a new InvalidOperationException.
public static T ThrowInvalidOperationException<T>();
static member ThrowInvalidOperationException : unit -> 'T
Public Shared Function ThrowInvalidOperationException(Of T) () As T
Type Parameters
- T
The type of expected result.
Returns
This method always throws, so it actually never returns a value.
Exceptions
Thrown with no parameters.
Applies to
ThrowInvalidOperationException<T>(String)
- Source:
- ThrowHelper.Generic.cs
- Source:
- ThrowHelper.Generic.cs
Throws a new InvalidOperationException.
public static T ThrowInvalidOperationException<T>(string? message);
static member ThrowInvalidOperationException : string -> 'T
Public Shared Function ThrowInvalidOperationException(Of T) (message As String) As T
Type Parameters
- T
The type of expected result.
Parameters
- message
- String
The message to include in the exception.
Returns
This method always throws, so it actually never returns a value.
Exceptions
Thrown with the specified parameter.
Applies to
ThrowInvalidOperationException<T>(String, Exception)
- Source:
- ThrowHelper.Generic.cs
- Source:
- ThrowHelper.Generic.cs
Throws a new InvalidOperationException.
public static T ThrowInvalidOperationException<T>(string? message, Exception? innerException);
static member ThrowInvalidOperationException : string * Exception -> 'T
Public Shared Function ThrowInvalidOperationException(Of T) (message As String, innerException As Exception) As T
Type Parameters
- T
The type of expected result.
Parameters
- message
- String
The message to include in the exception.
Returns
This method always throws, so it actually never returns a value.
Exceptions
Thrown with the specified parameter.