views:

317

answers:

3

Hi there,

doers anyone know of a good utility or program to interrogate a solution or a directory for all projects and tell you where circular references are and possible compile in order..

I remember see one a while ago but i can't find it anywhere..

A: 

You could chase down the dependency tree via System.Reflection. As you build the tree, when adding a node, you would check to see if any parents of the node are the same project or assembly as the one you're adding. If true, throw an exception out to the user.

Throwing technical exceptions like this one are ok if your users will be people who know how assembly references and exceptions work - people like Developers :)

tsilb
+5  A: 

NDepend is an excellent tool that will do this and a lot more. Maybe it's overkill for what you want, but there's a trial version so have a look...

GraemeF
Yep this has many features but i like it .. thanks
mark smith
A: 

If you use project references between the projects in your solution the correct build order will be determined automatically by Visual Studio (or MSBuild). This breaks of course if you use assembly references.. Also Visual Studio will stop you from adding circular project references.

andyp