名称包含在注释中使用cref的无效字符

时间:2013-12-11 08:22:29

标签: c# xml comments

/// <summary>
/// ...
/// Use <cref="SiX_Dg_RequestStop"/> function to stop this function from another thread.
/// </summary>
public static void SiX_Dg_Execute()
{
}

public static void SiX_Dg_RequestStop()
{
}
此代码中的

cref链接提供以下编译器警告:

C:\Project\file.cs(1337,22): warning CS1570: XML comment on 'AtpDotNet.ATP.SiX_Dg_Execute()' has badly formed XML -- 'A name contained an invalid character.'

如何解决?

1 个答案:

答案 0 :(得分:2)

因为这不是有效的XML(缺少节点名称):

<cref="SiX_Dg_RequestStop"/>

将其更改为:

<see cref="SiX_Dg_RequestStop"/>