0

Is there a way to get code analysis to ignore line breaks <br> when giving me spelling warnings about text in my resource files? I know I can add them to my code analysis dictionary but I'm pretty sure there is a way to get them ignored without that.

The warning is the standard CA1703 warning which for br tags gives me something like:

correct the spelling of 'br' in string value 'blah blah <br> blah'

This is a normal winform project using Visual Studio 2010.

ЯegDwight
  • 24,821
  • 10
  • 45
  • 52
monk
  • 3
  • 4

1 Answers1

-1

Add a file called CustomDictionary.xml to your project

That looks something like

<?xml version="1.0" encoding="utf-8" ?>
<Dictionary>
  <Words>
    <Recognized>
      <Word>br</Word>
    </Recognized>
  </Words>
</Dictionary>

or may be <br>, may be, never used it on tags.

More info on it here VS Code Analysis and dictionaries

Tony Hopkinson
  • 20,172
  • 3
  • 31
  • 39
  • yeah, I know I can add them to the dictionary but isnt there a way to get them ignored without that? I feel like I'm missing something simple. Thx -CM – monk Oct 01 '12 at 15:39
  • You could supress it into the global supression file and then edit that, so it would accept more targets. That turns out to be less simple that CustomDictionary though, and a bit of a non-standard approach. – Tony Hopkinson Oct 01 '12 at 16:25
  • After some more research I am convinced there really isnt another way to do it so I'm marking this answer as correct. Thx – monk Oct 01 '12 at 17:55