visual studio c# mark class deprecated

C#
[Obsolete("This class should not be used anymore!", true)]
public class MyObsoleteClass
{
    ...
}

Source

Also in C#: