I'm working on an ASP.NET web site and I'd like to deploy the pdb files because when unexpected exceptions are thrown, I want to log them with line numbers so I can track down the problem.
But I'm concerned about security and performance.
Is there any security risk to having pdb files on a web server, if I use the stack trace information to log to a non-public file on the web server and don't show it to the user?
As far as performance, I know that it's more expensive to deal with exceptions when there's a pdb file, but the goal is not to have any exceptions, and on the rare case when they occur, to get good tracing data so we can fix the problem.
But one thing I'm not clear about is this: if an exception is thrown and caught, do I still pay the pdb penalty? I'm thinking particularly about the ThreadAbortException thrown when you Response.Redirect
. This is a legacy app with a lot of these as part of normal program flow, and so I just catch and ignore these exceptions, but will the presence of a pdb file make this much more costly? Or does .NET ignore the pdb file unless you ask for the stack trace (which I don't, for this particular exception)?
Beyond that, as long as there are no exceptions except for ones I really do want to know about in detail, is there any performance hit from deploying pdb files to the web server?