Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 813631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:23:32+00:00 2026-05-15T01:23:32+00:00

I’ve recently upgraded my project from Visual Studio 2008 to Visual Studio 2010. By

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T01:23:33+00:00Added an answer on May 15, 2026 at 1:23 am

    "Can't initialize MyClass" is not a good message for a developer to introduce into code. It rarely aids in debugging and it only confuses the end user if it’s ever displayed.

    In general, I would say don’t suppress the message because spelling error makes one look much dumber than they really are and that’s not a message you want to convey with your app.

    In this specific instance, it’s really a warning of a poor error message — either tell the user how to correct it, correct it automatically, or include the actual reason it isn’t initializing in your error log.

    EDIT: Including OP’s edits
    Something you can take from this warning is that you shouldn’t be revealing code details as part of an error message (primarily because they will be included in the call stack when you log the exception).

    GetResult() has failed for some reason
    Let’s say “some reason” is permissions. The message could read:

    You don’t have permission to view these results.

    There’s no need to mention the specific method that failed because the stack trace can be logged automatically.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
Seemingly simple, but I cannot find anything relevant on the web. What is the
this is what i have right now Drawing an RSS feed into the php,
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.