Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Visual Studio/Tools show me the Circular Dependency Graph when I add a reference to a project?

I am working with a solutions having large number of projects. I am trying to refactor some peices into Common libraries. However, while adding some project reference, I get the circular dependency error. I have tried to remove the unused references from my VS Solution but circular dependency still exists.

Are you aware of any VS extensions or external tools that can help me know the circular dependency. I have Resharper too but I am not aware if the Code Cleanup can help me for this issue.

like image 491
vinayvasyani Avatar asked Oct 25 '12 19:10

vinayvasyani


People also ask

What is circular dependency in C#?

In software engineering, a circular dependency is a relation between two or more modules which either directly or indirectly depend on each other to function properly. Such modules are also known as mutually recursive.

How do you handle circular references in C#?

To handle the problem of circular references in C#, you should use garbage collection. It detects and collects circular references. The garbage collector begins with local and static and it marks each object that can be reached through their children. Through this, you can handle the issues with circular references.

How do I find a circular reference in a project?

If you click on the references for that project, it will have a yellow triangle under it. Those are your circular (or other errors) references.


1 Answers

This is an old question, but since it doesn't have an accepted answer...

In at least VS 2015 Enterprise, you can right click on your solution in the Solution Explorer and select Show Project Dependency Diagram. This will load a diagram of the dependencies within your solution. Very useful for large solutions.

enter image description here

like image 91
Steve Avatar answered Sep 28 '22 05:09

Steve