Topic | Value |
---|---|
Id | GU0005 |
Severity | Warning |
Enabled | True |
Category | Gu.Analyzers.Correctness |
Code | ObjectCreationAnalyzer |
Use correct position for name and message.
ArgumentException
& ArgumentNullException
has different positions for parameterName
and message
.
Changing exception type between the two is very likely to introduce an error.
Use the code fix or manually change the argument positions.
Configure the severity per project, for more info see MSDN.
#pragma warning disable GU0005 // Use correct argument positions
Code violating the rule here
#pragma warning restore GU0005 // Use correct argument positions
Or put this at the top of the file to disable all instances.
#pragma warning disable GU0005 // Use correct argument positions
[System.Diagnostics.CodeAnalysis.SuppressMessage("Gu.Analyzers.Correctness",
"GU0005:Use correct argument positions",
Justification = "Reason...")]