If you have ever worked with an application that has a large number of assemblies, it can be daunting at times to manage the entire set. In particular, you will find that developers may reference external assemblies that perhaps they should not be referencing. For instance, would you want to deploy an ASP.NET application where developers reference and use types in System.Windows.Forms?
Here is how you can find those pesky references in your build output directory. From a command line in the path of your build’s binaries, type in the following command:
(FOR %i IN (*.dll) DO ILDASM /TEXT /PUBONLY /ITEM=Assembly %i | FINDSTR /L System.Windows.Forms) > Output.txt
Then, open the Output.txt and search “.assembly extern System.Windows.Forms.” This will show you which assemblies are referencing System.Windows.Forms, if any.
Very Cool….
Comment by Tad Anderson — 19 February 2010 @ 8:12