|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to make stacktrace include linenumber for release compiles?Hi. I've noticed that, when I build an exe in release mode (as opposed to
debug mode), the StackTrace for exception does not include line numbers. Is there a way that I can build in release mode and still get the line number in my stack traces? =?Utf-8?B?RGFu?= <D**@discussions.microsoft.com> wrote in
news:37BA6250-AFEE-4222-B918-43E647B00A26@microsoft.com: I believe you have to include the debug PDBs.> > Hi. I've noticed that, when I build an exe in release mode (as > opposed to debug mode), the StackTrace for exception does not include > line numbers. Is there a way that I can build in release mode and > still get the line number in my stack traces? > > I have figured out how to do it. In project properties "optimizations"
uncheck "enable optimizations". In project properties "build", check "Generate Debugging Information". 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. Is there a way you can get the line numbers without deploying the "pdb" file? Show quoteHide quote "Dan" wrote: > Hi. I've noticed that, when I build an exe in release mode (as opposed to > debug mode), the StackTrace for exception does not include line numbers. Is > there a way that I can build in release mode and still get the line number in > my stack traces? > Problem is, to get the line numbers to come out, it seems you've got to That is my understanding - if you want line numbers, you deploy the .pdb > deploy the "pdb" file which gets generated in the build. This seems a bit > insecure. 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. Thanks for your comments. I agree with you recommendation for MSFT.
I don't see any place to specify such compiler options for a VB.NET project (at least working from within VS.NET). Am I missing it? Dan Show quoteHide quote "AMercer" wrote: > > 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. > > I don't see any place to specify such compiler options for a VB.NET project Probably not. I'm on shaky ground here, but you probably have to leave the > (at least working from within VS.NET). Am I missing it? confines of VS.NET. This raises the question of whether the experiment is worth the trouble given its low (my estimate) probablity of success. As I said before, you are not the first to raise this issue. I wish someone from MS would give some guidance. Is anybody listening? Maybe an MVP can make a most valuable contribution - after all, that is why they pay the MVPs the big bucks (just kidding). Who knows - maybe MS is about to release a ..net upgrade that includes a .pdb with options. Sorry, I don't have any answers, only an open ended experiment of dubious value.
check username and password in database
A question of design REPLACE method: unwanted multiple-replacement Detect right-click in MDI container's client area? Encrypt a date to use in demo version System.Diagnostics.Process.Start Freezes No Recursive instr?!! RTf to Word.Doc Visual Studio Proffessional 2005 Finding embedded controls? |
|||||||||||||||||||||||