为什么Visual Studio 2005在发布版中编译时会生成.pdb文件?我不会调试发布版本,那么为什么要生成它们呢?


当前回答

PDB可以为发布生成,也可以为调试生成。这是设置在(在VS2010中,但在VS2005中必须相似):

项目→属性→构建→高级→调试信息

只需将其更改为None。

其他回答

调试符号(.pdb)和XML文档(. XML)文件占总大小的很大比例,不应该成为常规部署包的一部分。 但如果需要的话,应该可以访问它们。

一种可能的方法是:在TFS构建过程的末尾,将它们移动到一个单独的工件。

PDB可以为发布生成,也可以为调试生成。这是设置在(在VS2010中,但在VS2005中必须相似):

项目→属性→构建→高级→调试信息

只需将其更改为None。

Without the .pdb files it is virtually imposible to step through the production code; you have to rely on other tools which can be costly and time consuming. I understand you can use tracing or windbg for instance but it really depends on what you want to achieve. In certain scenarios you just want to step through the remote code (no errors or exceptions) using the production data to observe particular behaviour, and this is where .pdb files come handy. Without them running the debugger on that code is impossible.

实际上,如果没有PDB文件和他们拥有的符号信息,就不可能创建一个成功的崩溃报告(内存转储文件),微软也不会完全了解导致问题的原因。

因此,拥有PDB可以改善崩溃报告。

此外,您还可以利用崩溃转储来调试软件。客户将它发送给您,然后您可以使用它来识别源代码的确切版本——Visual Studio甚至会使用崩溃转储提取正确的调试符号集(如果设置正确,还会提取源代码)。请参阅微软关于符号商店的文档。