user255445
user255445

Reputation:

SuppressMessage in interface

I tried to suppress a particular FxCop warning for a method defined in an interface by adding SuppressMessage attribute to the method. But the warning still appears. I know the SuppressMessage attribute is the right choice.

public interface ICustomerAccess
{
  [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design",
    "CA1024:UsePropertiesWhereAppropriate",
    Justification = "This method involves time-consuming operations", Scope="member")]
  IList<ICustomer> GetCustomers();
}

Does anyone have the experience on suppressing FxCop warning in an interface?

Thanks,

H

Upvotes: 2

Views: 1575

Answers (1)

Laurent Etiemble
Laurent Etiemble

Reputation: 27929

For the record, the answer is in the question's comments:

@Angelina said: Thank you very much! I am able to resolve the issue by adding CODE_ANALYSIS to the project.

Upvotes: 2

Related Questions