16

One of the suggestions of Resharper 6.0 was to localize strings, and if I didn't want a string to be localized, I could suppress the warning by converting it to a verbatim string literal by adding a @.

After upgrading to Resharper 6.1, this doesn't work anymore. Even verbatim string literals are showing the warning.

Disabling localization or suppressing the warnings isn't an ideal option. I do use localization so the warnings are helpful, and I don't want to have the disable comments littered everywhere.

Is there an option to get Resharper 6.1 to ignore verbatim string literals?

AakashM
  • 62,551
  • 17
  • 151
  • 186
Brandon
  • 68,708
  • 30
  • 194
  • 223
  • are you sure that teh string literals that you are using are defined properly as well as being used in the correct place ..? – MethodMan Jan 17 '12 at 19:28
  • 1
    @DJKRAZE, What exactly do you mean? Even a simple line such as `var test = @"test";` will give the warning. – Brandon Jan 17 '12 at 19:38
  • where are you declaring the var statement.. inside the method hopefully.. it's hard to tell what's going on without seeing some actual method or something.. have you looked at compiler setting in resharper as well...?? – MethodMan Jan 17 '12 at 19:46

1 Answers1

28

Under ReSharper / Options, go to:

Code Editing -> C# -> Localization

And check "Don't analyse verbatim strings"

Grant Winney
  • 65,241
  • 13
  • 115
  • 165
Rob H
  • 1,840
  • 16
  • 25
  • 1
    That, or you could turn it to a suggestion instead of a warning in the options menu under "inspection severity". – Steven Jeuris Jan 17 '12 at 19:59
  • 1
    I was trying to find that - I've had it changed to hide that inspection for so long that I forgot where to find it! – Rob H Jan 17 '12 at 20:01
  • Awesome, thanks. I don't know why this option didn't carry over in the upgrade, but it's nice to have it back. – Brandon Jan 17 '12 at 20:04
  • 1
    Shouldn't this be **check** rather than **uncheck** to allow the OP to avoid the warnings for string literals? – Sir Crispalot Jul 23 '14 at 07:53