ADepends: Viewing Assembly Dependencies

ADepends is a useful utility buried in the \FrameworkSDK\Tool Developer Guide \Samples\ADepends folder. It's a C# sample program. Once you've compiled it using the supplied batch file and the nmake tool, you can point it at any .NET assembly and it will tell you all the assemblies that the target assembly depends on.

Why do you need this type of information? You may want to know the assembly dependencies to create an installation program or to verify the dependencies shown by an existing installation program ”this is especially useful for checking version numbers. Alternatively, you can use the information to help create a custom configuration file that supplies a policy about dependent assembly version numbers that your application requires. You can also use ADepends to identify those assemblies that might need to have their permissions traced in the case of asecurity exception. Security exceptions are often caused by a permission problem somewhere deep within a call stack rather than by the assembly that actually raised the exception because, by default, a specific permission is required by every assembly within a call stack.

If you point ADepends at itself, you can see a good example of the sort of information available (see Figure 5-4). The first line shows the name , version, culture, and public fingerprint of the assembly under analysis. Then you can see the list of assemblies and modules used directly. The assemblies in this case are mscorlib , System.Windows.Forms , Accessibility , System.Xml , System.Drawing , and System . The analysis then continues recursively, showing all of the lower assembly dependencies.

click to expand
Figure 5-4: ADepends's view of itself

Comprehensive VB .NET Debugging
Comprehensive VB .NET Debugging
ISBN: 1590590503
EAN: 2147483647
Year: 2003
Pages: 160
Authors: Mark Pearce © 2008-2017.
If you may any questions please contact us: