c# - Making a third-party method [Obsolete] -


if want declare method in my code deprecated / obsolete, can add [obsolete] attribute , make compiler emit warning (or error) whenever method used.

is possible achieve similar effect third-party methods (such system.console.writeline)? obviously, cannot add attribute since not control code. maybe there other trick available in .net or visual studio?

i'm preferably looking "out of box" solution not require writing own post-build script manually parses code.

with visual studio 2015 can create live code analyzers can provide custom design-time checking virtually anything. tutorial available here. these live part of solution, so "follow around" no matter compiled.

code analyzers can can raise compile time errors or warnings, , can present ui automatically correct issue. can powerful, writing 1 of these can complex depending on need.

a similar feature exists previous versions of visual studio (2010+). isn't integrated, might work you.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -