By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,668 Members | 1,716 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,668 IT Pros & Developers. It's quick & easy.

Tool to show code references?

P: n/a
Does anyone know of a tool out there that will parse a project and show
the references between classes? Its easy enough to show association
through inheritance, but how can I show dependancy, like if a class
instantiates a member of a certain type, I would like to see that type
listed as a dependancy.

Is that information possibly in the meta-data for the assembly? Thanks
Nov 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
John,

No, this isn't in the assembly. You would have to perform a
code-analysis for this. A basic way of doing this would be to get the type
of the class. Once you have that, you would check the types of the fields,
the return types of the properties (as well as the type of the parameters in
the indexer if one exists), as well as the types of the parameters and
return values of each of the methods. This should give you a decent idea of
what dependencies exist between your classes.

However, it will be harder to figure out where derived classes are used
and whatnot. For that, you will actually have to find calls to new and
Activator.CreateInstance in the IL. Additionally, you will have to find the
return values of any methods or properties you call in your methods and
properties.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"John Parrish" <pl*******@me.com> wrote in message
news:Of**************@TK2MSFTNGP09.phx.gbl...
Does anyone know of a tool out there that will parse a project and show
the references between classes? Its easy enough to show association
through inheritance, but how can I show dependancy, like if a class
instantiates a member of a certain type, I would like to see that type
listed as a dependancy.

Is that information possibly in the meta-data for the assembly? Thanks

Nov 16 '05 #2

P: n/a
> Does anyone know of a tool out there that will parse a project and show
the references between classes? Its easy enough to show association
through inheritance, but how can I show dependancy, like if a class
instantiates a member of a certain type, I would like to see that type
listed as a dependancy.

Is that information possibly in the meta-data for the assembly? Thanks


Try 9Rays.Net Spices.Net (http://spices.9rays.net ) - this app has Modeler
plugin that shows various types of relations as between types and assemblies
diagrams - assembly references, interface implementations, inheritance and
nesting.
Diagrams can be exported as xml/uml, and as graphics.

--
Best regards,
Al Ponomarev
9Rays.Net

Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.