更新:2007 年 11 月
错误消息
XML 注释 cref 属性中的参数“parameter number”的类型无效
当试图引用重载格式的方法时,编译器检测到语法错误。这通常表明所指定的是参数名而不是类型。格式不正确的行将出现在生成的 XML 文件中。
下面的示例生成 CS1580:
// CS1580.cs
// compile with: /W:1 /doc:x.xml
using System;
/// <seealso cref="Test(i)"/> // CS1580
// try the following line instead
// /// <seealso cref="Test(int)"/>
public class MyClass
{
/// <summary>help text</summary>
public static void Main()
{
}
/// <summary>help text</summary>
public void Test(int i)
{
}
/// <summary>help text</summary>
public void Test(char i)
{
}
}