Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/328.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C#xml文档错误_C#_Documentation - Fatal编程技术网

C#xml文档错误

C#xml文档错误,c#,documentation,C#,Documentation,我正在尝试将文档添加到我的C#代码中。但是下面给出了一个格式错误的xml错误。我知道这个错误是因为“列表”显示。它正在尝试查找“/显示”。但不会有“/显示”,因为它是我的代码示例的一部分。有人能帮我吗?多谢各位 /// <summary> /// Retrieves a list of <c>Display</c> /// </summary> /// <example> /// <

我正在尝试将文档添加到我的C#代码中。但是下面给出了一个格式错误的xml错误。我知道这个错误是因为“列表”显示。它正在尝试查找“/显示”。但不会有“/显示”,因为它是我的代码示例的一部分。有人能帮我吗?多谢各位

    /// <summary>
    ///   Retrieves a list of <c>Display</c>
    /// </summary>
    /// <example>
    ///   <code>
    ///     List<Display> templates = DisplayManager.GetDisplays();
    ///   </code>
    /// </example>
//
///检索显示列表
/// 
/// 
///

///List templates=DisplayManager.GetDisplays();
///
///
将代码包装在块中:


尝试在CDATA中包装代码内容

<![CDATA[List<Display> templates = DisplayManager.GetDisplays();]]>
templates=DisplayManager.GetDisplays();]>
XML文档中的所有文本都将由解析器解析

但是CDATA节中的文本将被解析器忽略


在XML文档中编写
List{Display}
是很常见的

///   <code>
///     List&lt;Display&gt; templates = DisplayManager.GetDisplays();
///   </code>
<![CDATA[List<Display> templates = DisplayManager.GetDisplays();]]>