问题描述
在Visual Studio 2010中为C#项目,如果您转到项目属性>构建>高级>调试信息您有三个选项:none,full或pdb-only。根据的答案,我相信我了解完全和pdb之间的一些区别。但是,哪个更适合发布版本?如果我用全会有性能后果吗?如果我使用pdb-only将难以调试生产问题?
In Visual Studio 2010 for a C# project, if you go to Project Properties > Build > Advanced > Debug Info you have three options: none, full, or pdb-only. Based on the answer to this question, I believe I understand some of the differences between full and pdb-only. However, which is more appropriate for a release build? If I use "full" will there be performance ramifications? If I use "pdb-only" will it be harder to debug production issues?
推荐答案
我将使用 pdb-only
。您将无法将调试器附加到已发布的产品,但如果您遇到崩溃转储,则可以使用Visual Studio或,以检查崩溃时的堆栈跟踪和内存转储。
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.
如果您使用
而不是 pdb-only
,您将获得同样的好处,除了可执行文件可以直接附加到调试器。您需要确定是否合理,因为您的产品&客户。
If you go with full
rather than pdb-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.
确保将PDB文件保存在某个位置,以便在崩溃报告进入时引用它们。如果您可以设置存储这些调试符号,如果您选择使用 none
构建,那么当遇到崩溃时,您将无法获得追索权。
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.
关于成效的说明:
和已经写了关于 / debug
标志的博文,他们都表示此设置具有零性能影响。有一个单独的 / optimize
标志,指示编译器是否应该执行优化。
Both John Robbins and Eric Lippert have written blog posts about the /debug
flag, and they both indicate that this setting has zero performance impact. There is a separate /optimize
flag which dictates whether the compiler should perform optimizations.
这篇关于我应该使用调试信息编译发布版本为“full”或“仅限pdb”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!