19

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.

vinayvasyani
  • 1,393
  • 4
  • 13
  • 34

4 Answers4

12

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

Steve
  • 9,335
  • 10
  • 49
  • 81
  • 6
    Unfortunately Project Dependency Diagram is not a feature of VS 2015, it is a feature of Resharper. Too bad it gets confused by circular references which is the primary reason I need this tool for. – Konstantin Erman Oct 08 '16 at 04:16
  • type dependency diagram is what you want for a single project and seeing if your types have any circular dependencies. – odyth Mar 04 '17 at 23:13
2

"Right click on the project"->"Project dependencies" and check if you have a dependency setted here, cause this can be the reason of your problem (of course I assume you have no circular dependecies in "References")

danijepg
  • 347
  • 1
  • 4
  • 15
1

There is a similar question, with a suggested tool in: c# : Utility to find circular references / compile in correct order?

The tool: http://www.ndepend.com/features/dependency-cycles#DependencyCycle

Patrick from NDepend team
  • 13,237
  • 6
  • 61
  • 92
maiconmm
  • 311
  • 4
  • 16
0

I just stumbled accross the same issue. Project 'A' did not directly reference Project 'B' (otherwise finding out what was wrong would have been easy). But i still got the error when i tried to add reference to Project 'B'.

What i did was check all the referenced Projects from Project 'B' and i found a Child-Reference/Dependency that itself already had a reference to 'A'.

Long story short: you have to check all "child"-dependecies aswell.

What helped here was:

  • Right click on Solution
  • Project Dependecies ...
  • Navigate through Project 'B' and all its "child"-dependecies
Luqqu
  • 186
  • 1
  • 9