开发者

SuppressMessage in interface

开发者 https://www.devze.com 2022-12-17 20:35 出处:网络
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 Suppre

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

精彩评论

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