re: Differences between Release and Debug build [assembler code included] VIEW POST


Did you try same example in release mode by turning off code optimization in project property?


Good point. I have used the default settings. I will try this today and update the article


Well it will still not hit the breakpoint, what I wanted to say is difference in IL code is due to optimization but optimization does not stop debugging.

In release mode, pdb files are not generated, without pdb files vs cannot debug anything.

Pdb is mapping of machine code to source code.

Sorry for the late response. Yes you are completely right. PDB files are necessary to debug our C# code.

I have added the IL code for both, Release and Debug build. You are right, at IL level optimizations are done. It maybe is a bit misleading but was necessary as a simple example.

Very interesting topic, though!

code of conduct - report abuse