编译器错误 CS0619
更新:2007 年 11 月
错误消息
“member”已过时:“text”
类成员是用 Obsolete 属性标记的,以致在引用该类成员时会发出错误。
下面的示例生成 CS0619:
// CS0619.cs
using System;
public class C
{
[Obsolete("Use newMethod instead", true)] // generates an error on use
public static void m()
{
}
// this is the method you should be using
public static void newMethod()
{
}
}
class MyClass
{
public static void Main()
{
C.m(); // CS0619
}
}