I am relatively new to programming and have started using VS 2013 instead of C# Express 2010. I was curious what is the difference between debug and build folders in the bin directory?
-
Thanks friends I appreciate the clarification. – Brian Smith Dec 20 '13 at 04:42
4 Answers
Debug and release are 2 different configurations. You cna read details here.
Debug Mode isn't optimized and is compiled in such a way so that easy debugging is possible. you can run through your code while in debug mode. Whereas, it is not possible if you have configured your application for release mode.
Release mode is optimized for performance and should be used when you are deploying your application.
As the names imply, you build the Debug version for debugging and the Release version for the final release distribution. If you create your program in Visual Studio, Visual Studio automatically creates these configurations and sets appropriate default options and other settings. With the default settings: The Debug configuration of your program is compiled with full symbolic debug information and no optimization. Optimization complicates debugging, because the relationship between source code and generated instructions is more complex. The Release configuration of your program contains no symbolic debug information and is fully optimized. Debug information can be generated in PDB Files, depending on the compiler options that are used. Creating PDB files can be very useful if you later have to debug your release version.

- 31,833
- 6
- 56
- 65
-
This only applies to the files in the bin folder correct? Building it doesn't have any effect on the code in VS correct? – Brian Smith Dec 20 '13 at 04:39
-
yes this is correct. But compiled files are different. When you build in release mode you will see files updated in release folder. And in other case debug folder will be updated. – Ehsan Dec 20 '13 at 04:40
Debug
and Release
are different configurations for building your project.
You generally use the Debug
mode for debugging your project, and the Release
mode for the final build for end users.
The Debug
mode does not optimize the binary it produces (as optimizations can greatly complicate debugging), and generates additional data to aid debugging.
In debug mode the compiler emits debug symbols for all variables and compiles the code as is. In release mode some optimizations are included:
- unused variables do not get compiled at all
- some loop variables are taken out of the loop by the compiler if they are proven to be invariants
- code written under #debug directive is not included etc.
The rest is up to the JIT.
The Release
mode enables optimizations and generates less (or no) extra debug data.
Please see following Links:
Hope this helps you :)

- 1
- 1

- 5,964
- 15
- 85
- 143
You use build configurations in Visual Studio to control steps to be taken when you compile your code. You get two, debug and release, build settings by default.
From http://msdn.microsoft.com/en-us/library/wx0123s5.aspx:
The Debug configuration of your program is compiled with full symbolic debug information and no optimization. Optimization complicates debugging, because the relationship between source code and generated instructions is more complex.
The Release configuration of your program contains no symbolic debug information and is fully optimized. Debug information can be generated in PDB Files, depending on the compiler options that are used. Creating PDB files can be very useful if you later have to debug your release version.

- 1,484
- 1
- 11
- 21
For .NET programs (C#/VB), debug build and release build have little difference. You can still deploy an unoptimized debug build of exe/dll. Optimization does not make big difference.
For C++ programs, Debug build depends on debug version of VC runtime dll, which is not supposed to be deployed. Debug build is usually not much optimized, larger in size, and runs more slowly. Release build depends on release version of VC runtime dll, which can be deployed. Release build is usually optimized, smaller in size, and runs faster.

- 19,828
- 10
- 59
- 83