Invalid XML comment: invalid character

XML comment contains invalid XML: A name was started with an invalid character 

This is the IntelliSense documentation message I receive. Something clearly doesn't match my documentation, but I can't find what.

  /// <summary> /// The local-part of an email adress may use any of these ASCII characters (As according to RFC 5322 <see href="http://tools.ietf.org/html/rfc5322"></see>): /// - Uppercase and lowercase English letters (a–z, A–Z) (ASCII: 65-90, 97-122) /// - Digits 0 to 9 (ASCII: 48-57) /// - Characters !#$%&'*+-/=?^_`{|}~ (ASCII: 33, 35-39, 42, 43, 45, 47, 61, 63, 94-96, 123-126) /// - Character . (dot, period, full stop) (ASCII: 46) provided that it is not the first or last character, and provided also that it does not appear two or more times consecutively (eg John..Doe@example.com is not allowed.) /// - Special characters are allowed with restrictions. They are: Space and "(),:;<>@[\] (ASCII: 32, 34, 40, 41, 44, 58, 59, 60, 62, 64, 91-93) /// - The restrictions for special characters are that they must only be used when contained between quotation marks, and that 3 of them (The space, backslash \ and quotation mark " (ASCII: 32, 92, 34)) must also be preceded by a backslash \ (eg "\ \\\""). /// </summary> 

I guess this has something to do with all the characters, but I don't know ...

+6
source share
1 answer

In this line:

  /// - Special characters are allowed with restrictions. They are: Space and "(),:;<>@[\] (ASCII: 32, 34, 40, 41, 44, 58, 59, 60, 62, 64, 91-93) 

The < character will be interpreted as the beginning of the Xml tag (and > as the end). Replace them with &lt; and &gt; respectively. You may also need to avoid other characters such as & c &amp; .

Here is a complete list of Xml / Html character objects.

+13
source

Source: https://habr.com/ru/post/956059/


All Articles