ThrowIfArgumentNull<T> Method
- Last UpdatedSep 29, 2026
- 1 minute read
Throws if argument is null.
'Declaration
Public Shared Sub ThrowIfArgumentNull(Of T As Class)( _
ByVal argument As T, _
ByVal argumentName As String _
)
public static void ThrowIfArgumentNull<T>(
T argument,
string argumentName
)
where T: class
public:
static void ThrowIfArgumentNullgeneric<typename T>
(
T^ argument,
String^ argumentName
)
where T: ref class
Parameters
- argument
- The argument.
- argumentName
- Name of the argument.
Type Parameters
- T
- type
| Exception | Description |
|---|---|
| System.ArgumentNullException | throws an instance of ArgumentNullException |
Target Platforms:
- Windows 10 Enterprise, IoT Enterprise 2019 LTSC (1809)
- Windows 10 Enterprise 2021 LTSC (21H2)
- Windows 10 IoT Enterprise (Only) 2021 LTSC (21H2)
- Windows 11 Enterprise, IoT Enterprise 2024 LTSC 24H2
- Windows Server 2019 LTSC (Datacenter, Essentials, Standard)
- Windows Server IoT 2019 LTSC
- Windows Server 2022 LTSC Standard and Datacenter
- Windows Server 2025 LTSC Standard and Datacenter