10.2.3.Obsolete attribute: warn the user that Method is obsolete
using System;
class MainClass
{
[Obsolete("Method1 has been replaced by NewMethod1", false)] public static int Method1()
{ return 1;
}
public static void Main()
{
Console.WriteLine(Method1());
}
}
ObsoleteattributewarntheuserthatMethodisobsolete.cs(18,21): warning CS0618: 'MainClass.Method1()' is
obsolete: 'Method1 has been replaced by NewMethod1'
1