Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
任何人都可以向我指出用于识别“string ==”用法的 fxcop 规则。例如:
string s = "abc"; if (s == "def") { // do somethign }
我希望将“if”语句作为错误提出。粗略地说,我希望始终将 string.compare 与适当的文化一起使用。
谢谢!
您可能必须为此编写自己的自定义规则,但这应该不会太难。请参阅此处找到的文件。此外,使用.NET Reflector查看 FxCop 库并了解这是如何完成的。