【发布时间】:2015-03-17 09:20:39
【问题描述】:
我正在尝试通过这行代码抑制 SA1300 的 Style Cope 警告。
[SuppressMessage("StyleCop.CSharp.NamingRules","SA1300:ElementMustBeginWithUpperCaseLetter", Justification = "Reviewed.")]
它在类级别上工作(即,如果我把它放在有警告的类中然后它的工作)但如果我把它放在 GlobalSuppressions.cs 类中就不起作用。我想禁止整个程序集的 SA1300 警告,所以我将这一行放在 GlobalSuppressions.cs 中,但它不起作用。
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules","SA1300:ElementMustBeginWithUpperCaseLetter", MessageId = "Ctl", Scope = "namespace", Target = "Assembly name"))]
是否可以在“GlobalSuppressions.cs”中做到这一点? 它也不适用于“SA1600”
【问题讨论】: