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


当前回答

为什么您如此确定您不会调试发布版本?有时(希望很少,但确实会发生),您可能会从客户那里得到一个缺陷报告,由于某些原因(不同的时间,小的不同行为或其他原因),该报告在调试版本中是不可重复的。如果该问题在发布版本中是可重复的,那么您将很高兴拥有匹配的pdb。

其他回答

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文件的大小增加。它在我们测试应用程序时使用。

pdb文件的好文章。

http://www.codeproject.com/Articles/37456/How-To-Inspect-the-Content-of-a-Program-Database-P

为什么您如此确定您不会调试发布版本?有时(希望很少,但确实会发生),您可能会从客户那里得到一个缺陷报告,由于某些原因(不同的时间,小的不同行为或其他原因),该报告在调试版本中是不可重复的。如果该问题在发布版本中是可重复的,那么您将很高兴拥有匹配的pdb。

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

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