visual studio 2010 - Should I suppress CA2204: Literals should be spelled correctly? -


I have recently upgraded my project from Visual Studio 2008 to Visual Studio 2010.

By enabling the code to be analyzed, I get a lot of warnings, resulting in the CA 2204 rule: literal should be written correctly.

EDIT :

Let's say I have a method called GetResult () , and I have some reason in it I want to throw exceptions. I want an exception to say "GetResult () has failed for some reason" . This will warn me because GetResult is not a word. I will not get a warning on the method name GetResult () , then I'll put it in the string. That's because go and the results are legal words.

I do not think that writing GetResult () has failed for some reason is the solution.

Edit : It says:

This rule reads the literal string in the word, Mixed words point to , and spell checks for each word / token.

It does not mean that GetResult should check as two words: "go" and "result"?

Should I suppress CA2204?

"MyClass can not be started" No good for developers Message is not an introduction to the code It is rarely helpful in debugging and it only confuses the end user if it is ever displayed.

In general, I would say do not suppress the message because the spelling error is a lot more dumper than a reality and this is not a message that you want to express with your app.

In this specific example, this is actually a warning of a bad error message - either tell it how to correct it, correct it automatically or the actual reason it includes Your error log Can not start in.

Edit: Include the edits of OP
You can take some of this warning that you should not be part of the code description, an error message (the main reason Because when you log exception, the call will be included in the stack).

GetResult () has failed for some reason Cause "is the permission to read the message:

You can see these results Not allowed.

There is no need to mention the specific method that stack traces can be automatically logged in.


Comments