In Visual Studio for a C# project, if you go to Project Properties > Build > Advanced > Debug Info you have three options: none, full, or pdb-only.
Which setting is the most appropriate for a release build?
So, what are the differences between full and pdb-only?
If I use full will there be performance ramifications? If I use pdb-only will it be harder to debug production issues?
I would build with
pdb-only. You will not be able to attach a debugger to the released product, but if you get a crash dump, you can use Visual Studio or WinDBG to examine the stack traces and memory dumps at the time of the crash.If you go with
fullrather thanpdb-only, you’ll get the same benefits, except that the executable can be attached directly to a debugger. You’ll need to determine if this is reasonable given your product & customers.Be sure to save the PDB files somewhere so that you can reference them when a crash report comes in. If you can set up a symbol server to store those debugging symbols, so much the better.
If you opt to build with
none, you will have no recourse when there’s a crash in the field. You won’t be able to do any sort of after-the-fact examination of the crash, which could severely hamper your ability to track down the problem.A note about performance:
Both John Robbins and Eric Lippert have written blog posts about the
/debugflag, and they both indicate that this setting has zero performance impact. There is a separate/optimizeflag which dictates whether the compiler should perform optimizations.