Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access the StackTrace when deploying in Release mode

I'm not entirely sure if the StackTrace does not work correctly when deploying in release mode, however, we want to log all the exceptions so we can make bug tracking easier when deploying, and of course, deploying in debug mode is not an option. The info we need from the StackTrace class is the file name, the method, and the line number in which the exception occurred.

What settings do I need to get these three values from the StackTrace and minimize the extra debugging info that deploying in Debug mode brings?

Thanks.

like image 372
Carlo Avatar asked Feb 27 '10 02:02

Carlo


1 Answers

You would need to deploy your .pdb symbol files in order to do that in Release mode (and possibly turn off some optimisations, which may or may not be acceptable).

Related SO questions:

  • Display lines number in Stack Trace for .NET assembly in Release mode

  • How to generate PDB’s for .net managed projects in release mode? (cheers, Nick)

  • Print stack trace information from C#

  • Is showing the Exception StackTrace useful in a RELEASE assembly or only a DEBUG .dll

like image 140
Mitch Wheat Avatar answered Sep 29 '22 06:09

Mitch Wheat