Question

If this is a duplicate question, I apologize in advance. I am sure someone has asked it before, but I didn't find it. Anyway, here it goes.

I have a complicated web application that is in production. From time to time, we get errors that are logged, including the stack trace, but are difficult to pin down. I would like to have access to the line numbers of the error, which requires the debug files be present on the server.

I see a lot of advice always about not including those files for security reasons. I am less concerned about that in this instance. Is there any other downside to including the debug files on the production site, such as a dip in performance?

Edit: Just to refine the question a bit, I am proposing to still compile the application to Release mode, but to also include the PDB files in the solution.

Was it helpful?

Solution

Depending on what your uptime requirements are, one option would be to deploy both the Release and Debug folders side by side and switch between them. Basically you have your bin folder as per normal and you can have a bin_debug directory next to it.

During normal production, you just run from bin directory as usual. If you want to track down a bug or an error, rename bin to bin_release and bin_debug to bin. You will have a performance hit for a few days while you track down the bug, but you will get more detailed error messages. Once you've identified the issue, you can switch back to the release directory.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top