Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

warning CS1570: XML comment on 'myclass' has badly formed XML -- 'A name was started with an invalid character.'

I have some C# codes using doxygen comments for some equations. VS2013 should me a warning message

warning CS1570: XML comment on 'myclass' has badly formed XML -- 
'A name was started with an invalid character.'

My comments are as follows and "<" caused this warning messages.

/// \f[
/// T_{max}<30
/// \f]

I really have to get rid of this warning messages. The best option is not to change the compile options to ignore this warning.

How should I fix it? Thanks for any suggestions.

like image 697
Bangyou Avatar asked Apr 14 '15 07:04

Bangyou


1 Answers

Yes, you need to escape the < - in XML it's &lt;.

So this would be valid:

/// \f[
/// T_{max}&lt;30
/// \f]

Now I don't know how doxygen handles comments in C# - if it really wants the original form, because it's not handling the comments as XML, then you should turn off XML commenting in the C# project settings. (Basically you either need to provide valid XML, or you need to stop anything from expecting it to be valid XML.)

like image 175
Jon Skeet Avatar answered Sep 16 '22 17:09

Jon Skeet