Suppose there are two .net projects not under same solution. ProjectA is under solution1 and ProjectB is under solution2. ProjectA has a reference of ProjectB and ProjectB has reference of ProjectA. There are two classes ProjectA_Class and ProjectB_Class. ProjectA_Class creates the object of ProjectB_Class and ProjectB_Class creates the object of ProjectA_Class.
namespace ProjectB
{
public class ProjectB_Class
{
public ProjectB_Class()
{
ProjectA_Class projA = new ProjectA_Class();
}
}
}
namespace ProjectA
{
public class ProjectA_Class
{
public ProjectA_Class()
{
ProjectB_Class projB = new ProjectB_Class();
}
}
}
I am confused about circular dependency. Isn't it creates a circular dependency between two classes though they are not in the same solution? We know if this two projects reside in the same solution Visual studio won't allow us to reference ProjectA in ProjectB and ProjectB in ProjectA as it creates circular dependency. Isn't it create circular dependency among two projects still though they are not in the same solution? Suppose, there is a class C in ProjectA who creates an object of ProjectB_Class and ProjectB_Class does not use any instance of Class C. Isn't it a circular dependency as ProjectA and ProjectB both has reference of each other?
Update 1 Can you please explain the condition of circular dependencies?