Anyone knows any free Visual Studio add-in that would find and/or delete dead (unused) code? I saw such possibility in MZ-Tools, but it's a little expensive as for private use ;)
Asked
Active
Viewed 2,298 times
2 Answers
2
Depends... For .NET you can use FxCop for finding usused code and variables.

Simon Linder
- 3,378
- 4
- 32
- 49
-
Hmm, but FxCop analyzes the managed code. I'm not sure if it would do the thing? – brovar Mar 29 '10 at 09:34
-
You get warnings like: CA1804: Remove unused locales; or CA1811: Avoid uncalled private code; So I would say that is something... – Simon Linder Mar 29 '10 at 09:37
1
You can also install ReSharper. It generally warns about unused variables and methods in a class file. You can see it as you are coding. It underlines it. It does seem to miss a couple but FxCop did seem to find the rest for me.
UPDATE: Sorry didn't see the FREE part. BUT after using ReSharper for a while it is definitely worth the money.

uriDium
- 13,110
- 20
- 78
- 138
-
You can at least use it as trial version for some days. I tested it (but didn't buy) and also think that it's really good. – Simon Linder Mar 29 '10 at 09:21
-
I've already heard many good things about Resharper, quite expensive unfortunately. – brovar Mar 29 '10 at 09:43