Reputation: 12490
Problem is that a large part of my codebase is using some methods that I now consider deprecated and I'd like to redirect the developer to some other method.
I'm aware of ObsoleteAttribute
, but that causes loads of warnings for all existing code. So, is there a way to avoid (at least partially, e.g. via pragma disable for an entire library) the use of some methods only for "new" code?
Upvotes: 3
Views: 1616
Reputation: 3025
AFAIK, a method/property is obsolete or is not.
The warnings are here to remind you that you still have to refactor code at these emplacements.
You can however at a project level ignore a specific warning if it fits your use case.
To achieve this, go to your project properties, then select the build tab.
You'll find an "Error and Warnings" group. Just put the number corresponding to the warnings you want to suppress in the text box. If you want to ignore more than one, separate them using commas.
Upvotes: 7