Using < > characters for generics within <code> </code> work around?

Jun 11, 2014 at 6:55 PM
While trying to wrap a code example for generics using <code> </code>, StyleCop chokes on the usage of < > characters within the code example:

/// <code>
/// Foo<Bar> test = new Foo<Bar>();
/// </code>

Am I just going about this the wrong way? Is there an alternative?

I'm developing in Unity, using MonoDevelop + StyleCop, and additionally use Doxygen generated output. The Doxygen output is correct and working with the above example. I am just trying to get around the SA1603 StyleCop warning.
Jun 12, 2014 at 10:29 AM
You have to use the HTML-escape codes, i.e.
Foo&lt;Bar&gt; test 
Jun 12, 2014 at 7:05 PM
Thanks, Daniel.

I should have mentioned that I tried that as a workaround but then ended up with it looking like that in the Doxygen documentation, not replacing the escape codes.

For now, I've opted to just use this in the specific class file:
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1603:DocumentationMustContainValidXml", Justification = "StyleCop Bug")]
Thanks again for the suggestion though.