views:

111

answers:

2

I know you can perform a 'Find All References' on a function and you can determine if it is being used anywhere, but is there a tool that will go through all of my functions and highlight any that are not called anywhere in the code?

+7  A: 

I believe ReSharper can do what you want. More specifically, the Safe Delete command should at least faciliate the job. Although I haven't tried it, the Code Cleanup tool may well do the whole thing automatically.

Noldorin
It does, although i believe it's for Visual Studio only.Highly recommend it by the way
Hal
Indeed, Visual Studio only. The OP has tagged their question with VS2008 however, so I think that's no matter.
Noldorin
+3  A: 

I prefer ReSharper for this, but if you're looking for a free product, Microsoft FxCop will identity unused public methods.

Brad Tutterow
We have used ReSharper, but no longer have a license for it so I checked out FxCop and it looks like it will only work on compiled assemblies and not code. I'll have to read more about it to make sure I am not missing something.
Scott
I didn't mention this before, but this is needed for a ASP c# web application so I don't have any compiled assemblies. Only .cs files and .aspx.cs files
Scott