c# : Utility to find circular references / compile in correct order?

后端 未结 5 1587
旧巷少年郎
旧巷少年郎 2020-12-11 18:37

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 o

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-11 19:29

    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 :)

提交回复
热议问题