<p>I'm sure we've all seen it before...A code base that has been around for a year or two, and as features have been added and bugs fixed, we end up with pieces of code that aren't actually in use anymore.  I'm wondering if there is a way (especially in VS.NET with or without a third-party tool) to search the codebase and show me which methods are NEVER used anywhere else in the code?</p>

<p>The one challenge I can think of in regards to this type of utility would be the inability to map back when implicit type conversions are occuring.  But assuming that wasn't a problem, what are my options?</p>

[{'answer_id': 15060, 'author': 'Keith', 'author_id': 905, 'author_profile': 'https://Stackoverflow.com/users/905', 'pm_score': 4, 'selected': True, 'text': '<p><a href="http://msdn.microsoft.com/en-us/library/bb429476(VS.80).aspx" rel="noreferrer">FxCop</a> will warn you of methods where nothing calls them.</p>\n'}, {'answer_id': 15065, 'author': 'rjzii', 'author_id': 1185, 'author_profile': 'https://Stackoverflow.com/users/1185', 'pm_score': 2, 'selected': False, 'text': '<p>As it turns out, one of the things that <a href="http://blogs.msdn.com/fxcop/" rel="nofollow noreferrer">FxCop</a> does is identify unused bits of code, but it sometimes misses stuff. However, your best bet would likely be <a href="http://www.jetbrains.com/resharper/" rel="nofollow noreferrer">ReSharper</a>.</p>\n'}, {'answer_id': 15082, 'author': 'Chris Smith', 'author_id': 322, 'author_profile': 'https://Stackoverflow.com/users/322', 'pm_score': 2, 'selected': False, 'text': '<p>Remember though that any public-facing method, property, or field can be accessed via reflection or in a derived type in a seperate assembly.</p>\n\n<p>FxCop is the right answer here, but you also need to limit accessibility to your code. I.e. decorate things with private/protected/internal where appropriate.</p>\n'}, {'answer_id': 1205089, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>The following tool can find orphan/unused code:</p>\n\n<p><a href="http://www.mztools.com/index.aspx" rel="nofollow noreferrer">MZ-Tools</a></p>\n'}]
['https://Stackoverflow.com/questions/15057', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1795/']