473,382 Members | 1,238 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

.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 18556
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
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
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
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
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
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
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
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
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
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.