11

Possible Duplicates:
Debug/Release difference
Performance differences between debug and release builds

What exactly is the different in compiling and running an asp.net/c# project in Debug mode VS Release Mode?

Community
  • 1
  • 1
InfoLearner
  • 14,952
  • 20
  • 76
  • 124
  • Exact dupe : http://stackoverflow.com/questions/933739/what-is-difference-between-release-and-debug-modes-in-visual-studio – gideon Mar 17 '11 at 12:04
  • Dupe 2 http://stackoverflow.com/questions/367884/debug-release-difference – gideon Mar 17 '11 at 12:04
  • Dupe 3 : http://stackoverflow.com/questions/3143244/visual-studio-debug-vs-release – gideon Mar 17 '11 at 12:05
  • And Dupe 4 http://stackoverflow.com/questions/4043821/performance-differences-between-debug-and-release-builds – Øyvind Bråthen Mar 17 '11 at 12:05
  • Use the SO/google search http://www.google.com/search?q=difference+between+debug+and+release+visual+studio&sitesearch=stackoverflow.com/questions&qscrl=1 – gideon Mar 17 '11 at 12:05
  • @Øyvind Knobloch-Bråthen and that would be 4! lol – gideon Mar 17 '11 at 12:06
  • For the record, no difference in Visual Studio 2010 and in `ASP.NET` environment it means the debug information is inserted to the `DLL` file of the web application. – Shadow The GPT Wizard Mar 17 '11 at 12:09

3 Answers3

26

In Debug Mode your .exe has debug information inside of it (source code, variable names and other similar stuff like that).

In Release Mode your .exe lack of debug information makes it smaller and probably performs better due to its smaller footprint.

Pablo Santa Cruz
  • 176,835
  • 32
  • 241
  • 292
  • 10
    Biggest diff is probably that in Release, many optimizations are turned on to make the program perform better, that would normally hamper the ability to debug the program. So it's not just the lack of debug info that is the difference. – Øyvind Bråthen Mar 17 '11 at 12:09
4

The biggest difference between these is that: In a debug build the complete symbolic debug information is emitted to help while debugging applications and also the code optimization is not taken into account. While in release build the symbolic debug info is not emitted and the code execution is optimized. Also, because the symbolic info is not emitted in a release build, the size of the final executable is lesser than a debug executable.

One can expect to see funny errors in release builds due to compiler optimizations or differences in memory layout or initialization. These are ususally referred to as Release - Only bugs :)

In terms of execution speed, a release executable will execute faster for sure, but not always will this different be significant.

saarthak
  • 1,004
  • 2
  • 12
  • 26
1

Other compile arguments who giving you more debug info in producted executable and many more options who you wan read at msdn.

http://social.msdn.microsoft.com/Forums/en/csharpgeneral/thread/74db169a-e244-496e-ae97-8dfec18ff2e5

Svisstack
  • 16,203
  • 6
  • 66
  • 100