4

Visual Studio 2010 is presenting some odd behaviour to do with circular dependencies, and as far I'm concerned... it's LYING; and I wonder if you can help me to sidestep it or point out my ignorance.

Essentially, I have assembly called REM that references nothing other than standard .NET DLL's, and an assembly called COR that references .NET assemblies and some other projects in the solution (none of which reference REM).

I want to have COR reference REM, but visual studio complains about a circular dependency and I just cannot figure out why.

Any help would be greatly appreciated.

Thanks, Clint.

5
  • 1
    Are you absolutely sure there is nothing (no other projects) that reference REM? Has COR and/or REM referenced each other previously? Could some previous version of COR or REM be referencing something other than what you are seeing in VS? Commented Oct 12, 2011 at 10:43
  • 2
    It turns out that even though REM held no explicit reference to COR; the project dependencies dialog against the solution had it that REM depended on COR (goodness knows why). "Removing" that dependency resulted in the reference being successfully added. :) Commented Oct 12, 2011 at 11:02
  • 1
    In other words it was telling the truth. This goes to show you that a program with 10 years of work would not have such a major bug in it. Commented Oct 12, 2011 at 11:20
  • 3
    Don't assume infallibility on the part of visual studio, it still has some fairly large bugs and oversights; it was telling the truth from the perspective that it believed there was a dependency, there wasn't however any reference made to the project to create the dependency - it was all down to visual studio managing a separate "dependency" list. Commented Oct 13, 2011 at 13:03
  • 1
    I encountered the same thing today, and @Clint's comment about the project dependencies dialog pointed me in the right direction. The project references were all screwed up; some were binary references to projects in the same solution, while others were project references. Commented Oct 3, 2012 at 16:39

2 Answers 2

2

Make sure you clean and rebuild both projects (You might also try closing and re-opening the project or solution, or even restart VS to make it reload the projects properly).

If you can't figure it out from VS, you might try using a decompiler to see what the actual DLL realy is referencing. (See for instance Just Decompile by Telerik, available from the bottom of this page: http://www.telerik.com/download.aspx ) Open the DLL-files, and you should be able to see what each of them references.

Sign up to request clarification or add additional context in comments.

Comments

0

It turns out that even though REM held no explicit reference to COR; the project dependencies dialog against the solution had it that REM depended on COR (goodness knows why). "Removing" that dependency resulted in the reference being successfully added.

I hit the same case today - I had a project A that previously was refernciong B, but that reference was then later removed from the project -- only to still linger in the Solution dependency list, generating a fake dependency.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.