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

.NetDeploymentRelease Management

.Net Problem Overview


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

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

.Net Solutions


Solution 1 - .Net

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

  1. Debugging
  2. Profiling

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 :(

Solution 2 - .Net

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

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.

Solution 3 - .Net

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

Solution 4 - .Net

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.

Solution 5 - .Net

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.

Solution 6 - .Net

Nope. You don't need to distribute them. It'll help with debugging (or I should say it will make debugging possible for 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.

Solution 7 - .Net

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.

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.

Solution 8 - .Net

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

Solution 9 - .Net

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.

Solution 10 - .Net

You don't need them to run.

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

Solution 11 - .Net

No, you don't have to deploy the .pdb file.

To quote from MSDN, "A PDB file is created when you build with /debug (Visual Basic/C#).", so it shouldn't be creating the debug database when compiling for release.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionboobooView Question on Stackoverflow
Solution 1 - .NetJaredParView Answer on Stackoverflow
Solution 2 - .NeterbiView Answer on Stackoverflow
Solution 3 - .NetDCNYAMView Answer on Stackoverflow
Solution 4 - .NetYuliyView Answer on Stackoverflow
Solution 5 - .NetAssaf LavieView Answer on Stackoverflow
Solution 6 - .NetDan EsparzaView Answer on Stackoverflow
Solution 7 - .NetPaulJView Answer on Stackoverflow
Solution 8 - .Netzildjohn01View Answer on Stackoverflow
Solution 9 - .NetTheMissingLINQView Answer on Stackoverflow
Solution 10 - .NetChen KinnrotView Answer on Stackoverflow
Solution 11 - .NetAlex FortView Answer on Stackoverflow