Click here to Skip to main content
Click here to Skip to main content

Project \ Assembly dependencies viewer

By , 11 Jan 2004
 

Sample Image - viewer.jpg

Introduction

This application is a part of the installation system that I use. My installation process uses an input XML file that is created by the application, to deploy and register the assemblies in the same locations as in the deploying machine. Using this method I reduce many errors. You can use this application to test your applications in a production environment. You can test and see if all of your application references match the files on your production server and to find out any existing problems.

The code is pretty straight forward. The only complicated part was to find out if a given assembly is registered as a COM+ component. To check it out, you need to get the COM+ component CLSID from COM+ using comadmin.dll, find in registry the CLSID InprocServer32 Key, and check if InprocServer32 Assembly string value matches the given assembly full name.

To navigate through the COM+, I use a wrapper assembly of comadmin.dll which I created using tlbimp.exe. The deploying code is a reference to the wrapper assembly of COM+ 1.5 comadmin.dll. If you are working with COM+ 1.0, you need to recreate the wrapper assembly using tlbimp.exe.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Natty Gur
Web Developer
Israel Israel
Member
Read my blog

 
http://weblogs.asp.net/ngur

Natty Gur is the founder and CTO of “The enterprise architects group” an international enterprise architecture consulting group based in Vestal, NY. Natty has 13 years of experience in the IT field, 7 of them focused on running enterprise architecture in companies and governmental bodies. Natty has written many articles and is a well known speaker on EA topics. You can reach natty at: natty@theeagroup.net


Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralRed color in the treememberuljo25 Feb '07 - 20:24 
Hi,
 
I guess it indicates that something is wrong. But what?
 
Br Ulf
GeneralRe: Red color in the treemembernhenny200025 Sep '07 - 11:33 
might want check the MSDTC service to see if it is having issue...might have event viewer errors.
GeneralI Got the solutionmemberavinash barnwal9 Jan '07 - 0:58 
Just Unregister the ComAdmin.dll from the C:\windows\system32\com\Comadmin.dll using
 
regsvr32 C:\windows\system32\com\Comadmin.dll /u
 
and register the comadmin.dll (1.0) version copied from the Windows 2000 Server on the Development (XP) PC.
 
Now Add the Reference to the newly Registered Comadmin.dll.
 
You will now find the Interop.Comadmin.dll in the Bin Folder of the .NET program using the Comadmin.dll.
 
Just Run ILDASM.EXE from the VS.NET 2003 Prompt and open this Interop.Comadmin.dll.
 
You should not find the COMAdminCatalog2 kind of thing in the end of the list.
 
and then deploy this Interop. and the recompiled .NET EXE to the Windows 2000 Server. and enjoy!!!
 
Enjoy!
Smile | :)
 
Avinash Barnwal
Software Developer.
FQS

Generalpowershell script to list out dependencies.membertovirtualme5 Jan '07 - 5:34 
Here's a lil powershell script to list out dependencies. It doesn't try to find where the assembly is being loaded up from, but sometimes one just want to find that pesky version mismatch.
hope it helps. Script
QuestionJob Role??membernc200026 Jun '06 - 5:18 
No offence intended - I was just wondering (based upon ur profile photo) is your present IT job/role anything to do with requirements gathering or contract negotiations - if so, luv ur style! Wink | ;)
 
BTW - nice app.
QuestionHow to enlist assemblies?memberzux8 Nov '04 - 1:44 
I need to check if some assembly exists on deployment machine (with probing: local folder/GAC).
 
I could do it by:
 
/////////////////////////////////
IDbConnection con=null;
Assembly asm=null;
asm=Assembly.LoadWithPartialName("Oracle.DataAccess");
if (asm != null)
{
// Do something
con=new
Oracle.DataAccess.Client.OracleConnection();
}
////////////////////////////////
 
Is there more efficient way, without loading assembly?
AnswerRe: How to enlist assemblies?memberNatty Gur19 Nov '04 - 9:24 
Hi,
 
If I got you right actually there is. If you open GAC folder from DOS prompt you will found out that actually GAC is build from folders naming after dlls name, version and strong key. You might use this info to find out if given DLL exist in GAC. Anyway I prefer to load assembly in order to gain such info.
 
Natty.

GeneralOther dependecy walkermembertolemac19 May '04 - 7:59 
Hi,
 
I have published my own .net dependency walker tool in my weblog:
 
tolemaC weblog
 
the web log is in spanish but the tool is in english, this is the link for the tool:
 
DependsNet.zip
 
tolemaC
QuestionDoes it make probing?memberIvan Fernandez21 Jan '04 - 5:39 
One question about your tool... Does it make probing if I scan a .exe with a exe.config file?
 
Thanks,
 
Ivan.
 
Iván Fernández
AnswerRe: Does it make probing?memberNatty Gur21 Jan '04 - 5:46 
If I get you right no. it just use metadata to get assembly dependent , check thier locations and validate if they really exist on your machine.
GeneralA graphical approachmemberdrewnoakes13 Jan '04 - 9:12 
Hi,
 
I've made a similar app that analyses dlls (and also vs.net solution files, though only for vs.net 2000). It then plots a dependancy chart using DOT.
 
You can see examples, download binaries and source here:
 
http://www.drewnoakes.com/code/dependancyanalyser/[^]
 
Regards,
 
Drew
 
Drew Noakes
drewnoakes.com
GeneralRe: A graphical approachmemberNatty Gur13 Jan '04 - 17:25 
Cool Big Grin | :-D ,
 
If you can add the logic of assembly location and indication if the reference assembly exist on disk I'm dropping mine and using it ...
GeneralRe: A graphical approachmembermephianna11 Feb '08 - 23:41 
Thank you!
This program was just what I needed!
Smile | :)
GeneralRe: A graphical approachmemberoliwan24 Jun '08 - 6:57 
Drew Noakes,
 
I opened your Solution with VS2005. VS2005 automatically converts the VS2000 format to VS2005 format. After compiling, your Dependency Analyser perfectly analyses .NET 2.0 Assemblys.
 
Good Program! Thanks.
 
--* Oli *--

NewsRe: A graphical approachmemberDrew Noakes4 May '11 - 17:24 
I recently moved my dependency analyser to Google Code, retargetted it for .NET 3.5 and made a few improvements.
 
http://code.google.com/p/dependency-analyser/[^]
Drew Noakes
drewnoakes.com

GeneralInterface Interop.COMAdmin.ICOMAdminCatalog2 failedmemberClaus Brod13 Jan '04 - 1:35 
Hi,
 
just downloaded the demo project and built it using VS.NET 2003. When I run the dependency viewer on a .NET assembly, I get the following runtime error:
 
An unhandled exception of type 'System.InvalidCastException' occurred in DevNetInstaller.exe
 
Additional information: QueryInterface for interface Interop.COMAdmin.ICOMAdminCatalog2 failed.
 
This happens in function IsDllInCom (ReadProject.cs). Can this be caused by inconsistencies due to different versions of comadmin.dll as you have described it in your article?
 
Thanks,
 
Claus (clausbrod.de)
 

GeneralRe: Interface Interop.COMAdmin.ICOMAdminCatalog2 failedmemberNatty Gur13 Jan '04 - 2:09 
Hi,
 
Two options:
 
1) as you mention, comadmin.dll may not work due to different versions or because I made the wrapper assembly with tlbimp of CLR 1.0.
 
2) There are inconsistent data in COM+ catalog. Usually there are situations where components are listed in the MMC tree but don’t show up on the MMC List (right side). You can see the COM+ application ID (in the code) and to check COM+ MMC for that application components.
 
Let me know what and if it helps you …

GeneralRe: Interface Interop.COMAdmin.ICOMAdminCatalog2 failedmemberClaus Brod13 Jan '04 - 2:16 
I already tried to build my own Interop.COMAdmin.dll from my local comadmin.dll. This did not help, so potential inconsistencies in the catalog are more likely; need to check that more thoroughly first.
 
Tnx!
 
Claus

GeneralRe: Interface Interop.COMAdmin.ICOMAdminCatalog2 failedmembernedcod13 Jan '04 - 22:41 
I had a similar problem.
 
Removing the Interop.COMAdmin.dll reference and adding COMAdmin.dll instead solved it.
 
Thanks, just what I was looking for!
GeneralRe: Interface Interop.COMAdmin.ICOMAdminCatalog2 failedmemberClaus Brod13 Jan '04 - 23:30 
Yup, this fixed the problem for me as well.
 
Thanks!
 
Claus

GeneralRe: Interface Interop.COMAdmin.ICOMAdminCatalog2 failedmembermayoroj2 Aug '05 - 12:30 
Sorry to bug, but I hav e a smilar problem.
How in c# do you make the reference directly to the dll instead of the interop?
GeneralRe: Interface Interop.COMAdmin.ICOMAdminCatalog2 failedgroupER GovindAgarwal12 Sep '12 - 3:04 
Hello please suggest!
I am not able to see either "Interop.COMAdmin.dll" or "COMAdmin.dll".
Please provide me which system requirement for it.. i have WIN7.
GeneralRe: Interface Interop.COMAdmin.ICOMAdminCatalog2 failedgroupER GovindAgarwal12 Sep '12 - 3:18 
Resolved: I found it in bin folder of the zip folder.
And you can found in C://windows/system32/com/comadmin.dll
Generaldemo .zip filememberAntonio Barros12 Jan '04 - 9:45 
Hi
 
I've downloaded your zip files and i think that the demo .zip is the same file that of the installer ?
Can you tell me if this is correct ?
 
Thank you
A.Barros

GeneralRe: demo .zip filememberNatty Gur12 Jan '04 - 16:56 
Yes, you can find DevnetInstaller.exe under /bin/debug directory.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web03 | 2.6.130523.1 | Last Updated 12 Jan 2004
Article Copyright 2004 by Natty Gur
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid