.net – the key difference between a ‘Debug’ and a ‘Release’ build in .NET?

.net

Duplicate of: Debug vs. release in .NET

Why are there 'Debug' and 'Release' modes on build in .NET applications?

What is the major technical difference between them?

Best Solution

Differences:

  • Debug inserts NOPs (No-operation CPU instructions) between useful CIL code in order to allow debugger attachment
  • Debug does not allow various optimizations:
    • Inlining (placing a method's code in place of a call to it in order to reduce call overhead)
    • Loop unrolling (replacing a loop code - such as a for - with the repeated code to eliminate loop overhead (loop variable maintenance))

And many others. Release is sensibly faster, but it offers no real debug support. For debugging there is... the debug mode :)