views:

45

answers:

1

Hi, 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

+1  A: 

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.

Laurent Etiemble