总结,成员忽略了格式错误的XML注释

时间:2011-09-08 13:59:07

标签: c# visual-studio

我正在使用Summary属性在VS 2010中记录我的班级成员。当我构建项目时,构建XML文件(稍后我将在开发中使用它)。类成员的摘要之一不包含在XML文件中,而是出现错误“成员忽略了格式错误的XML注释”。

摘要文字如下。我不明白什么是格式错误。我应该逃避&字符并使用%26吗?

    /// <summary>
    /// URI of a web page to convert. Must start with http:// or https://. Several URI of web pages can be passed to create one PDF. For example if http://www.google.com+http://www.nytimes.com URI will be passed the two web pages will be merged into one PDF.
    /// If URI has special characters like ? or & they must be encoded.
    /// </summary>

2 个答案:

答案 0 :(得分:20)

因为它是XML,你必须编码特殊字符。您的&标志(之前已经咬过我)需要替换为&amp;

答案 1 :(得分:3)

是的,您应该将&转义为&amp;