Here is source code of the C# Program to Create Obsolete Class. The C# program is successfully compiled and executed with Microsoft Visual Studio. The program output is also shown below.
* C# Program to Create Obsolete Class
static void Main()
[Obsolete("Use MethodB Instead")]
static void MethodA()
static void MethodB()
Console.WriteLine(" MethodA shows an Warning when called and MethodB is not an Obsolete Method ");
Here is the output of the C# Program:
MethodA shows an Warning when called and MethodB is not an Obsolete Method
Sanfoundry Global Education & Learning Series – 1000 C# Programs.