Visual Studio & Circular Dependency Issues

I have a legacy system made up of 15 different projects, and when I tried to link to it from another Visual Studio, it complains that it cannot do it as it will cause a circular dependency.

My problem is that I can't see how this will cause a circular dependency, since the project I'm trying to link to ("XScript") doesn't have any validation to the project that is trying to link to it ('WPF_Forms').

From researching around here, I've found that people suffer from similar judgments, although their problems seem to have obvious circular dependencies.

I downloaded a demo copy of NDepend as recommended a few posts from here, and even though I've worked with various dependency tools there is no obvious link there.

I right clicked on the projects and used the Project Dependencies option, but I don't see any link. I also restarted Visual Studio and tried "Clean Solution" and "Re-build Solution" to no avail.

The only way I could think of is to refer to "XScript" by referencing an inline DLL and not the project itself, however this is a bit messy and I want to know why this is happening quite simply hack it.

Can anyone suggest anything that I may have missed, or any strategies I could use to figure out what is going wrong?

EDIT 1: The XScript used to reference WPF_Forms, but that reference has been removed (and the project is cleaned up and rebuilt with no dependencies showing in the Project Dependencies window. I suppose it's possible that VS saved the reference somewhere or what it thinks is that the projects are related in some way.

EDIT 2: Following BitBonk's suggestion, I used the used VS Code Map feature and worked out the topology of the project. XScript and WPF_Forms only refer to the main .exe file and nothing else. I am starting to suspect this is a VS issue and I may have to create a new project and add all sub-projects again to get it working.

+3


source to share


3 answers


And the problem was this: Visual Studio 2012.

After using Code Map, for example, Bitbonk, I don't see any links that could cause the problem. So I removed both XScript and WPF_Forms from the project, ran the clean one, added the XScript back, started the clean one, and then added WPF_Forms and did the cleanup.



After that, adding a link from WPF_Forms to XScript did not cause any problems. I can only guess that this is a bug in VS that it caused, not recognizing that there is no longer an XScript dependency to WPF_Forms.

Hopefully this question and the suggested answers will help someone else in the future.

+8


source


As others have said, your circular dependency can span multiple levels. You can easily visualize the dependency graph using the viusal studio 2012 codemap feature. This way you can determine where it will happen.



enter image description here

+4


source


Perhaps your circular dependency includes more than two projects.

+1


source







All Articles