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

brasskazoo picture brasskazoo · Mar 16, 2009 · Viewed 23.5k times · Source

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:...?

Answer

Lou Franco picture Lou Franco · Mar 16, 2009

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.")>