How to properly deprecate methods

If you work with a C# class that has many deprecated methods in they clutter intellisense and you cannot see the useful methods anymore. To avoid this you can add the Annotation EditorBrowsable and disable intellisense:

[EditorBrowsable(EditorBrowsableState.Never)]
[System.Obsolete("use new method abc instead")]
        public void OldMethodThatShouldNotBeUsedAnymore() {
            // Do some stuff
        }

Leave a comment

Your email address will not be published. Required fields are marked *