In VB.NET, can I mark a function as deprecated?

vb.netFunctionDeprecated

vb.net Problem Overview


Is there an ability in VB.NET to deprecate code? I know that in C# there are 'attributes', and tags in java; is there anything similar in VB.NET, other than leaving a 'todo:...?

vb.net Solutions


Solution 1 - vb.net

There are attributes in VB.NET too:

Looks like this (before your function)

<Obsolete("This method is deprecated, use XXXX instead.")> _ 

And since VB.NET 10 (.NET 4 and later) we no longer need the underscore.

<Obsolete("This method is deprecated, use XXXX instead.")>

Solution 2 - vb.net

Use the [Obsolete] Attribute.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionbrasskazooView Question on Stackoverflow
Solution 1 - vb.netLou FrancoView Answer on Stackoverflow
Solution 2 - vb.netOtávio DécioView Answer on Stackoverflow