I want to know if any tool exists for removing unused references (not unused using
directives) within a .NET C# project.
views:
295answers:
4
A:
http://stackoverflow.com/questions/81597/remove-unused-references-using-visual-studio
MIght have an answer for you :).
bastijn
2009-11-24 08:25:52
He asked explicitly not how to remove unused `using` directives, but unused references.
dtb
2009-11-24 08:27:33
aye crap, I read too quickly, answer will be deleted.
bastijn
2009-11-24 08:28:38
+4
A:
I am unaware of such a tool off the top of my head - I do know that Visual Studio does not include one by default. However, referenced assemblies that are not actually used by code in the project are automatically removed by the C# compiler from the list of assemblies referenced by the compiled program. If you use Reflector, you can compare the list of actual references to the list of references in the project, and remove the unnecessary ones that the project includes based on that.
280Z28
2009-11-24 08:29:36