In standard Visual Studio there is no way, but there are utilities to install in it that can help.
In the Fxcop there are some rules that detect this, especially the
Private methods that are not called from any other code (CA1811)
It doesn’t solve everything, but it makes it obvious. If you have something public that hasn’t been used, you need to think about why it hasn’t been used, maybe it could be one day. I would not go out liming these methods so easily, let alone use them just to have use.
The Resharper can make a search in the whole solution. In the solution look for Find Code Issues
And then Unused Symbols
. Search not only unused methods.
You can also go on ReSharper
=> Inspect
=> Codes Issues
Then goes on Filter Issues
and there select Redundancy in Symbol Ddeclaration
=> type or type member is never use
.
There is still the Ndepend. You have to create a query, you have to example on the website.
By "no reference" you mean "unused"?
– Jéf Bueno
Very useful for working with legacy systems.
– David Schrammel