C#


ROSLYN.USAGE.CA2208 : Instantiate argument exceptions correctly (C#)

See Roslyn-Detected C# Warning Classes for more information.

Summary

A call is made to the default (parameterless) constructor of an exception type that is or derives from ArgumentException, or an incorrect string argument is passed to a parameterized constructor of an exception type that is or derives from ArgumentException.

This check corresponds to Roslyn rule CA2208. For full rule details, see the Microsoft website: CA2208.

Properties

Class Name Instantiate argument exceptions correctly (C#)
Significance reliability
Mnemonic ROSLYN.USAGE.CA2208
Categories None
Availability Available for C# only.
Enabling Checks for this warning class are enabled by default. To disable them, add the following WARNING_FILTER rule to the project configuration file.
WARNING_FILTER += discard class="Instantiate argument exceptions correctly (C#)"

Relevant Configuration File Parameters

The following configuration file parameters affect checks for this warning class.