爲了更好的可讀性,我使用下劃線作爲我的測試方法,並且想要爲整個測試命名空間抑制FxCop錯誤/警告。整個命名空間的SuppressMessage
我怎麼能做到這一點?
我打了GlobalSuppressions.cs但是毫無效果:
[module: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", Scope = "namespace", Target = "Company.Product.Tests)]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", Scope = "namespace", Target = "Company.Product.Tests)]
+1同上......我試着在AssemblyInfo.cs文件相似,它也沒有工作。也許CA1707不能定位到整個庫或名稱空間,而只能定位到成員本身。 – harlam357 2012-08-03 22:06:15