CA1801: Review unused parameters


This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, use the version selector at the top left. We recommend upgrading to Visual Studio 2019. Download it here

For the latest documentation on Visual Studio, see CA1801: Review unused parameters.

TypeName ReviewUnusedParameters
CheckId CA1801
Category Microsoft.Usage
Breaking Change Non-breaking - If the member is not visible outside the assembly, regardless of the change you make.

Non-breaking - If you change the member to use the parameter within its body.

Breaking - If you remove the parameter and it is visible outside the assembly.


A method signature includes a parameter that is not used in the method body. This rule does not examine the following methods:

  • Methods referenced by a delegate.

  • Methods used as event handlers.

  • Methods declared with the abstract (MustOverride in Visual Basic) modifier.

  • Methods declared with the virtual (Overridable in Visual Basic) modifier.

  • Methods declared with the override (Overrides in Visual Basic) modifier.

  • Methods declared with the extern (Declare statement in Visual Basic) modifier.

Rule Description

Review parameters in non-virtual methods that are not used in the method body to make sure no correctness exists around failure to access them. Unused parameters incur maintenance and performance costs.

Sometimes a violation of this rule can point to an implementation bug in the method. For example, the parameter should have been used in the method body. Suppress warnings of this rule if the parameter has to exist because of backward compatibility.

How to Fix Violations

To fix a violation of this rule, remove the unused parameter (a breaking change) or use the parameter in the method body (a non-breaking change).

When to Suppress Warnings

It is safe to suppress a warning from this rule for previously shipped code for which the fix would be a breaking change.


The following example shows two methods. One method violates the rule and the other method satisfies the rule.

using System;
using System.Globalization;

namespace Samples
    public static class TestClass
        // This method violates the rule.
        public static string GetSomething(int first, int second)
            return first.ToString(CultureInfo.InvariantCulture);

        // This method satisfies the rule.
        public static string GetSomethingElse(int first)
            return first.ToString(CultureInfo.InvariantCulture);

CA1811: Avoid uncalled private code

CA1812: Avoid uninstantiated internal classes

CA1804: Remove unused locals