Forced to Rebuild Project Depedencies in Visual Studio 2012

msbuild, visual-studio, visual-studio-2012

Solution

Did you set the dependency projects in your solution?

We can set them from:

Right click solution->Properties->Project Dependencies

By the way, did you build your solution in the Visual Studio IDE or by msbuild command?

If you use msbuild to build the projects, you should add DependsOnTargets attribute in your project files.

More information you can refer to:

http://msdn.microsoft.com/en-us/library/ms366724.aspx

Problem

I recently upgraded to VS.NET 2012 and I started encountering a very frustrating issue when debugging. Project A has a project reference to Project B. When I edit Project B, I would expect that action of building/debugging Project A to detect the change in Project B and automatically include it during the build of Project A. (That's kinda the point of project dependencies.) And that's exactly what used to happen in VS 2010. But this doesn't happen in 2012. Indeed, even if I build Project B explicitly, Project A will not pick up that change unless I rebuild project A. So now I'm forced to explicitly build Project B then go back to Project A and explicitly rebuild it for the modifications in Project B to be included. Thoughts?

Original source