I've recently upgraded my project from Visual Studio 2008 to Visual Studio 2010.
By enabling Code Analysis, I'm getting a lot of warnings resulted in rule CA2204: Literals should be spelled correctly.
EDIT:
Let's say I have a method called GetResult()
, and in it I want to throw an exception for some reason. I want the exception to say "GetResult() has failed for some reason"
. This will give me the warning since GetResult isn't a word. I won't get a warning on the method name GetResult()
, only if I put it in a string. This is because Get and Result are legal words.
I don't believe that writing GetResult() has failed for some reason
is the solution.
EDIT: In MSDN it says:
This rule parses the literal string into words, tokenizing compound words, and checks the spelling of each word/token.
Doesn't that mean that GetResult should be checked as two words: "Get" and "Result"?
Should I suppress CA2204?