CA1725: Parameter names should match base declaration
Note
This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here
Item | Value |
---|---|
TypeName | ParameterNamesShouldMatchBaseDeclaration |
CheckId | CA1725 |
Category | Microsoft.Naming |
Breaking Change | Breaking |
Cause
The name of a parameter in an externally visible method override does not match the name of the parameter in the base declaration of the method, or the name of the parameter in the interface declaration of the method.
Rule Description
Consistent naming of parameters in an override hierarchy increases the usability of the method overrides. A parameter name in a derived method that differs from the name in the base declaration can cause confusion about whether the method is an override of the base method or a new overload of the method.
How to Fix Violations
To fix a violation of this rule, rename the parameter to match the base declaration. The fix is a breaking change for COM visible methods.
When to Suppress Warnings
Do not suppress a warning from this rule except for COM visible methods in libraries that have previously shipped.