SuppressMessage in interface
I tried to suppress a particular FxCop warning for a metho开发者_Python百科d 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
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.
精彩评论