編譯器警告 (層級 3) CS0419
更新:2007 年 11 月
錯誤訊息
cref 屬性中有模稜兩可的參考: 'Method Name1'。假設為 'Method Name2',但是可能也已經符合其他多載,包括 'Method Name3'。
無法解析程式碼的 XML 文件註解中的參考。如果方法多載,或發現兩個同名的不同識別項,便會發生這個錯誤。若要解決這個警告,請使用限定名稱 (Qualified Name) 明確指出參考,或將特定多載放入括弧內。
下列範例會產生 CS0419:
// cs0419.cs
// compile with: /doc:x.xml /W:3
interface I
{
/// text for F(void)
void F();
/// text for F(int)
void F(int i);
}
/// text for class MyClass
public class MyClass
{
/// <see cref="I.F"/>
public static void MyMethod(int i)
{
}
/* Try this instead:
/// <see cref="I.F(int)"/>
public static void MyMethod(int i)
{
}
*/
/// text for Main
public static void Main ()
{
}
}