locked
Is it possible to obtain line numbers in the stack trace of an exception

    Question

  • Is it possible for e.StackTrace in the following code to contain line numbers?

    try {

    ... } catch(Exception e) { LogStackTrace("Stack Trace:" + e.StackTrace);

    }



    Hong

    Sunday, March 1, 2015 11:19 PM

Answers

  • Yes, it seems windows store does not support it.

    Windows Phone/Windows Store

    Tuesday, March 10, 2015 4:45 AM

All replies

  • To ensure that line numbers are included in stack trace you need to deploy .pdb files together with your dll-s. Program database (pdb) files are created when you build your app in Debug mode. You need to copy them to the same directory where dll-s are placed.

    A good article:
    http://www.geekchamp.com/news/how-to-get-exception-stacktrace-line-numbers-on-windows-phone .

    Monday, March 2, 2015 9:15 AM
  • Thank you for your response.

    The linked article is for Windows Phone and it points out "it's not possible to deploy the PDB alongside the EXE/DLL". Is this also the case for Windows Store app, or Windows Store app is different and it can be deployed with a .pdb file as you pointed out?

    The Windows Store app package is like the following:

    My App_1.3.0.5_AnyCPU.appxupload

    It is a zip file that contains the following two files:

    My App_1.3.0.5_AnyCPU.appx
    My App_1.3.0.5_AnyCPU.appxsym
    


    Hong

    Monday, March 2, 2015 12:00 PM
  • Yes, it seems windows store does not support it.

    Windows Phone/Windows Store

    Tuesday, March 10, 2015 4:45 AM