Can anyone point me to an fxcop rule for identifing "string ==" usage. For example:
开发者_开发技巧string s = "abc";
if (s == "def") {
// do somethign
}
I want the "if" statement raised as an error. Roughly speaking I want to always be using string.compare with the appropriate culture.
Thanks!
You might have to write your own custom rule for this, but it shouldn't be too hard. Refer to the files found here. Also, use .NET Reflector to look at the FxCop libraries and get an idea of how this is done.
精彩评论