In the Visual Studio default there is no way to. But there are utilities to install on it that can help.
In FXCop there are some rules that detect this, especially the
Private methods that are not called from any other code (CA1811)
It does not solve everything, but it does the most obvious thing. If you have something public that was not used you need to think about why it was not used. Maybe it could be one day. I would not leave filing these methods so easily. Much less use them just to have use.
Resharper can search the entire solution. In the solution search for Find Code Issues
and then Unused Symbols
. Go get not only unused methods.
You can also go in ReSharper
= > Inspect
= > Codes Issues
Then it goes in Filter Issues
and there select Redundancy in Symbol Ddeclaration
= > type or type member is never use
.
You also have NDepend . You have to create a query. You have example on the site .