Philippe Truche’s Blog

16 February 2010

How to find which assembly is referencing a specific assembly

Filed under: Uncategorized — Philippe Truche @ 10:17

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.

Advertisements

1 Comment »

  1. Very Cool….

    Comment by Tad Anderson — 19 February 2010 @ 8:12


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: