views:

320

answers:

2

Hey

I just wondered if it possible within Visual Studio 2008 / 2010 to automatically remove all references from a project that were never been used.

+1  A: 

In a Visual Basic project there is support to remove "Unused References" (Project-->References-->Unused References). In C# there isn´t such a function.

The only way to do it in a C# project (without other tools) is to remove possible unused assemblies, compile the project and verify if any errors occur during compilation. If none errors occur you have removed a unused assembly. (See my post)

If you want to know which project (assembly) depends on other assemblies you can use NDepend.

Jehof
In VS 2008/2010 there's a right-click menu option to remove or remove and sort usings.
JohnB
@JohnB : Of course you are right, but his question is about references (to assemblies) and not usings (of namespaces).
Jehof