I'm using visual studio 2010, and its a C++ solution with multiple projects. I have project A which has reference to project B(Properties->Common Properties->Framework and References). Project C references project A. Now the build order is B->A->C. C now indirectly references B, is it required that we should manually add Project B as reference to project C? I want to make sure that when project C is built project B should automatically be built if any changes were made to it and it is not rebuilt yet.
Asked
Active
Viewed 147 times
1 Answers
0
Building your Solution should always build Projects that have changes.
A circular dependency is created if you try to make B->A->C->B. You can have circular dependencies in VS but the build order must be managed manually. See this post.
If a Project references an assembly and not the Project that builds that assembly then VS does not build the dependent Project. If the Project references the Project that builds the dependent assembly then any changes to the dependent Project are built before the target Project. This is the default behavior in VS. That behavior can be changed or managed using the 'Build Dependency' dialog.
-
my question is if I choose 'Build->Build B(ProjectName)' will all dependencies of B which was changed be built again? @jcyost – Coder777 Feb 19 '14 at 01:21
-
Under the Project properties you can specify dependencies... at least you can in VS2012, just checked. Look for 'Project Dependencies' or 'Build Order'. If configured correctly there any dependent project will get built first when you build the target project. – John Yost Feb 19 '14 at 01:24
-
I clarified my answer and added a couple of points. Hope it helps. – John Yost Feb 19 '14 at 02:11