Is there an annotation in .NET which allows methods or classes to be deprecated so that their use and their callers are identified by the compiler (cf @Deprecated in Java)
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
[Obsolete]attribute.You can add a comment on what people should be using, for example:
If you want to generate a compiler error when people use your method:
This is an example for a method, but it can be used on almost any attribute target. See here for full docs.
Since the question was edited slightly, I’ll add the VB.NET syntax as well, to cover the most common .NET languages: