Problem is, to get the line numbers to come out, it seems you've got to
deploy the "pdb" file which gets generated in the build. This seems a bit
insecure.
That is my understanding - if you want line numbers, you deploy the .pdb
file, and you in essence you publish your source code. In closed
environments, that is probably ok, but it is not good for commercial products.
Is there a way you can get the line numbers without deploying the "pdb" file?
Here is an experiment you can try if you are up to it. The /Zd and/or /Z7
compiler options talk about line numbers without a .pdb file. During the
compile phase, some extra information is included in the .obj file. Maybe
this information is included in the .exe file, perhaps with an additional
linker option. Maybe the debugger and/or stacktrace will respect the line
number info when it is located in the .exe file vice the .pdb file.
I give this suggestion has a modest probability of success. Debug info in
the .obj file is an older concept than a .pdb file, and I guess that the
older way is no longer supported (a conjecture, not a fact). However, some
digging about compiler and linker options and a few experiments should tell
the tale. My specific guess is that you will be able to get line numbers
into the .exe file but that .net will not use them. If you have any success,
please post back.
Others have raised this problem. My suggestion to MS is to provide /brief
..pdb files for release configuration and /full .pdb files for debug
configuration.