473,498 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

.NET Dependency Walker?

Does anyone know of a tool, similar to Depends.exe (Dependency Walker) for
..NET assemblies? I'm looking for a way to report on inter-assembly
dependencies. Maybe a Visio plugin that would help map out dependencies
without littering the UI with properties, methods, etc?

Thanks,
Mark
Jul 21 '05 #1
2 18565
Mark A. Richman <no****@nospam.com> wrote:
Does anyone know of a tool, similar to Depends.exe (Dependency Walker) for
.NET assemblies? I'm looking for a way to report on inter-assembly
dependencies. Maybe a Visio plugin that would help map out dependencies
without littering the UI with properties, methods, etc?


Here's a fairly simple thing: give it the name of which
assembly/assemblies you want it to look through. If an entry appears in
square brackets, that means the dependencies for that assembly have
been listed earlier. Let me know if you have any problems with it.

using System;
using System.Reflection;
using System.Collections;

public class DependencyReporter
{
static void Main(string[] args)
{
try
{
if (args.Length==0)
{
Console.WriteLine
("Usage: DependencyReporter <assembly1> [assembly2 ...]");
}

Hashtable alreadyLoaded = new Hashtable();
foreach (string name in args)
{
Assembly assm = Assembly.LoadFrom (name);
DumpAssembly (assm, alreadyLoaded, 0);
}
}
catch (Exception e)
{
Console.WriteLine ("Error: {0}", e.Message);
}
}

static void DumpAssembly (Assembly assm, Hashtable alreadyLoaded,
int indent)
{
Console.Write (new String(' ', indent));
AssemblyName fqn = assm.GetName();
if (alreadyLoaded.Contains(fqn.FullName))
{
Console.WriteLine ("[{0}]", fqn.Name);
return;
}
alreadyLoaded[fqn.FullName]=fqn.FullName;
Console.WriteLine (fqn.Name);

foreach (AssemblyName name in assm.GetReferencedAssemblies())
{
Assembly referenced = Assembly.Load(name);
DumpAssembly(referenced, alreadyLoaded, indent+2);
}
}
}

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #2
Reflector: http://www.aisto.com/roeder/dotnet/
--
____________________
Klaus H. Probst, MVP
http://www.vbbox.com/

"Mark A. Richman" <no****@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Does anyone know of a tool, similar to Depends.exe (Dependency Walker) for
.NET assemblies? I'm looking for a way to report on inter-assembly
dependencies. Maybe a Visio plugin that would help map out dependencies
without littering the UI with properties, methods, etc?

Thanks,
Mark

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
389
by: mike | last post by:
Hi I am trying to find a tool that shows a dependency tree for method calls from an assembly. If the method call chain goes across assemblies, this would also be shown I have looked at dependency...
2
8011
by: Chris Capel | last post by:
Say ... does anyone know of a good (perhaps free) .NET assembly dependency walker? Because when you have a project A with a reference B which is also a reference of C, and C is also a reference of...
1
2775
by: Bruno van Dooren | last post by:
i regularly use the dependency walker, but to my horror i discovered that it is not installed with visual c++ anymore. is there a replacement for it, or do i have to keep on using it from VC6? ...
3
7175
by: DJTN | last post by:
I'm getting the following error when I try to compile my setup project in VS 2002. I have re-installed the .net framework 1.1 and it didnt solve the problem. WARNING: Unable to find dependency...
2
351
by: Mark A. Richman | last post by:
Does anyone know of a tool, similar to Depends.exe (Dependency Walker) for ..NET assemblies? I'm looking for a way to report on inter-assembly dependencies. Maybe a Visio plugin that would help map...
2
2073
by: Cachaca | last post by:
Hi. Do you guys know how can I find all the DLL file names being used by an EXE within a visual c++ program? I know there's a tool called Dependency Walker can do this but I need the source codes...
1
2788
by: cartoper | last post by:
For years I have lived and died by depends.exe (Dependency Walker) to determine what other DLL/modules my C/C++ code needed for installs. Is there such a tool for .net assemblies?
11
16173
by: phnimx | last post by:
I've completed migrating one of our company's C++ Managed Code applications to VS2005. I'm now attempting to run the application but there seems to be problems when accessing an object that is...
1
2517
by: vincentt | last post by:
Hi, We code DLL's and so far it was done using VS6.0. We are planning to migrate the VS.NET 2005 and use the VS6 VC++ code which generated the DLL to VS 2005 VC++.NET. However we donot plan to...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7165
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6887
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5462
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4910
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4590
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1419
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
291
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.