开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜