Search code examples
c#.netvisual-studio-2010commentsxml-comments

Escape pointy brackets in C# XML comments


I'm writing a simple compare function with the following signature:

  /// <summary>
  /// Casts two unsigned integers to signed integers and compares them
  /// </summary>
  /// <param name="arg1">Left side of inequality</param>
  /// <param name="arg2">Right side of inequality</param>
  /// <returns>
  /// LESS_THAN if arg1    <----
  /// </returns>
  private static Inequality Compare(uint arg1, uint arg2)

I would like to put literal inequality symbols where the arrow is without triggering the XML parser. How can I do this?


Solution

  • If you want to see it in the documentation above the method itself, then you can't, just write it out in full, it's clearer too.

    For all other purposes (like code insight, generated documentation, etc.), you can use the literal

    &lt;
    

    Use

    &gt;
    

    For greater than.