.net 您是否必须通过在发布下编译来部署 .pdb 文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/608002/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 12:15:52  来源:igfitidea点击:

Do you have to deploy the .pdb file with compiling under release?

.netdeploymentrelease-management

提问by

Do you have to deploy the .pdb file with compiling under release?

您是否必须通过在发布下编译来部署 .pdb 文件?

Why does it even compile a .pdb when you do a release build anyway?

无论如何,当您进行发布构建时,为什么它甚至会编译 .pdb?

回答by JaredPar

No you do not need to deploy them.

不,您不需要部署它们。

As to why they are even built in release. A PDB file really has a couple of uses but the primary ones (at least for me) are

至于为什么它们甚至内置于发布中。PDB 文件确实有几个用途,但主要用途(至少对我而言)是

  1. Debugging
  2. Profiling
  1. 调试
  2. 剖析

Both of these tasks are validly done on release binaries which is why release builds include a PDB. In fact, when debugging Watson dumps it's 100% of the time against a release build. Without a PDB I would have to resort to looking through dissasembly :(

这两项任务都在发布二进制文件上有效完成,这就是发布版本包含 PDB 的原因。事实上,在调试 Watson 转储时,它 100% 的时间都是针对发布构建的。如果没有 PDB,我将不得不通过拆卸来查看 :(

回答by erbi

You don't have to deploy and distribute the PDB files along with your binaries.

您不必随二进制文件一起部署和分发 PDB 文件。

However, I suggest that you keep them (and eventually index them) to be able to analyze any dump files that clients, QA, and support people send you. This way, you will be able to have comprehensible stack traces and symbol information.

但是,我建议您保留它们(并最终将它们编入索引),以便能够分析客户、QA 和支持人员发送给您的任何转储文件。这样,您将能够获得易于理解的堆栈跟踪和符号信息。

回答by DCNYAM

If you want, you can also turn the PDB file generation off in the compile options.

如果需要,您还可以在编译选项中关闭 PDB 文件生成。

回答by Yuliy

a PDB file contains information about names of functions. You need it to be able to get a stack trace. It can also contain information about mapping it to sources. Sometimes you might want to ship your release version, and still need to analyze a crash that occurs on the client side. For that, the PDB is needed. The PDB when compiling for release should in theory have less information than when compiling for debug.

PDB 文件包含有关函数名称的信息。您需要它才能获得堆栈跟踪。它还可以包含有关将其映射到源的信息。有时,您可能希望发布发布版本,但仍需要分析客户端发生的崩溃。为此,需要 PDB。理论上,编译发布时 PDB 的信息应该少于编译调试时的信息。

回答by Assaf Lavie

PDB files contain debug symbols that allow you to debug your binary even in release mode. You don't have to (and probably shouldn't deploy them), as they might be used to reverse engineer your application. Do keep them archived somewhere, though, because they come in very handy when you want to debug a crash dump.

PDB 文件包含调试符号,即使在发布模式下也允许您调试二进制文件。您不必(并且可能不应该部署它们),因为它们可能用于对您的应用程序进行逆向工程。但是,请务必将它们存档在某个地方,因为当您想要调试故障转储时,它们会派上用场。

回答by Dan Esparza

Nope. You don't need to distribute them. It'll help with debugging (or I should say it will make debugging possiblefor sane people).

不。您不需要分发它们。这将有利于调试(或者我应该说,这将使得调试可能为有理智的人)。

You can also turn off or adjust the 'level' of symbols generated in Visual Studio -- just go to Project Properties / 'Build' tab / 'Advanced' -- and make adjustments to the 'Debug info' field.

您还可以关闭或调整 Visual Studio 中生成的符号的“级别”——只需转到“项目属性”/“构建”选项卡/“高级”——并对“调试信息”字段进行调整。

回答by PaulJ

As the majority of the people on this thread have said: no, you don't have to ship the PDB file(s); but really you should if you ever intend to release the code into the wild.

正如该线程上的大多数人所说:不,您不必发送 PDB 文件;但如果您打算将代码发布到野外,您真的应该这样做。

It's really about being able to support your application. Without the PDB, when you application crashes, all your user will be able to tell you is the raw memory address of where the application crashed; but with the PDB file you get an error you can actually do something about.

这实际上是关于能够支持您的应用程序。如果没有 PDB,当您的应用程序崩溃时,您的用户只能告诉您应用程序崩溃的原始内存地址;但是对于 PDB 文件,您会收到一个错误,您实际上可以做些什么。

回答by Chen Kinnrot

You don't need them to run.

你不需要它们运行。

pdb files can be used to debug even if the build is on release configuration.

即使构建是在发布配置上,pdb 文件也可用于调试。

回答by TheMissingLINQ

Some tools like AVICode's InterceptStudio use the pdb files to view the source of a particular exception/stack trace/local from within the tool, rather than having to open up the source and go to a specific line.

某些工具(如 AVICode 的 InterceptStudio)使用 pdb 文件从工具内查看特定异常/堆栈跟踪/本地的源,而不必打开源并转到特定行。

回答by zildjohn01

No, you don't ship the .pdb files. They are generated because sometimes it's helpful to be able to debug a release build.

不,您不发送 .pdb 文件。生成它们是因为有时能够调试发布版本很有帮助。