Why have separate Debug and Release folders in Visual Studio?

Dave Mateer picture Dave Mateer · Jan 12, 2010 · Viewed 13.4k times · Source

By default, of course, Visual Studio creates separate bin folders for Debug and Release builds. We are having some minor issues dealing with those from the perspective of external dependencies, where sometimes we want release binaries and sometimes debug. It would make life slightly easier to just have a single bin folder on all projects and make that the target for both Debug and Release. We could then point our external scripts, etc. at a single location.

A co-worker questioned why we couldn't just do that--change the VS project settings to go to the same bin folder? I confess I couldn't really think of a good reason to keep them, other than easily being able to see on my local filesystem which are Debug and which are Release. But so what; what does that gain?

My question(s):

  • How do you leverage having distinct Debug and Release folders? What processes does this enable in your development?
  • What bad thing could happen if you fail to retain this distinction?
  • Inversely, if you have gone the "single folder" route, how has this helped you?

I am NOT asking why have separate Debug and Release builds. I understand the difference, and the place of each. My question concerns placing them in separate folders.

Answer

Andriy Shvydky picture Andriy Shvydky · Jan 12, 2010

Dave, if you will compile Debug and Release to single folder, you may encounter the situation where some dll-s will not be recompiled after switching from Release to Debug and vice versa because dll files will be newer than source files. Yes, the "Rebuild" should help you, but if you forget this - you can have a few extra hours of debugging.