Pages

Thursday, September 8, 2011

Circular dependancies in Visual Studio

If you add project A as a reference in project B, you can't add project B as a reference in project A if both projects are in same solution.
Because, Visual Studio explicitly disable circular dependancies among projects in a solution.


Error you get when you create a circular dependancy in a Visual Studio solution

It is a bad practice to allow circular dependancies between .dlls, because in the above scenario, if you change A you need to rebuild B and since B is changed you need to rebuild A and vise versa, thus creating an infinite loop which can cause a memory leak in the server.

No comments:

Post a Comment