Let's say that we have 3 projects in our visual studio solution. Project A, B and C.
Project A code:
public class A
{
public void someMethodA()
{
B b = new B();
b.someMethodB(new C());
}
}
Project B code:
public class B
{
public void someMethodB(C c)
{
c.foo(); // we do something with C, call C's method
}
}
Project C code:
public class C
{
public void foo()
{
return; // just for testing
}
}
Project B has a reference to project C, as it needs it (class C is needed in someMethodB). Project A has a reference to project B as it creates new object B and calls B's method - someMethodB().
At this point our solution won't compile, because project A needs reference to project C - it calls b.someMethodB(new C()) which needs project C. Does project A really needs reference to project C? Can't it get it from project B which also references it. I know that each project generates its own dll file and in bin directory there are 3 files, but still it could get what it needs from project B.
Project C isn't B domain, but we could get reference to C throught B.