接口中的SuppressMessage

时间:2010-01-21 03:16:36

标签: fxcop suppress-warnings

我试图通过向方法添加SuppressMessage属性来抑制接口中定义的方法的特定FxCop警告。但警告仍然出现。我知道SuppressMessage属性是正确的选择。

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

有没有人有在界面中抑制FxCop警告的经验?

谢谢,

ħ

1 个答案:

答案 0 :(得分:2)

对于记录,答案在问题的评论中:

  @Angelina说:非常感谢!一世   能够通过添加来解决问题   CODE_ANALYSIS到项目。