Tech Off Thread

14 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Getting line number in Exception for ASP.NET

Back to Forum: Tech Off
  • User profile image
    JParrish

    Hoping someone may have overcome this before.

    I use the enterprise library exception handling block to email myself any errors that occur within my ASP.NET application. At one time, I was getting the line numbers of the exceptions. I realize the performance hit but it is ok while I am testing deployment in new environments. Lately I have not been able to get the line numbers any more which makes the error too ambiguous. I have my build configurations to active debug, and in the web.config compilation debug is true.

    For libraries I call from the web app, I have the pdb files deployed into the bin folder. Does anyone know anything more I can check/do to try and get the exception to include the line number? I am using fixed name single page assemblies if that matters.

  • User profile image
    ScanIAm

    JParrish wrote:
    

    Hoping someone may have overcome this before.

    I use the enterprise library exception handling block to email myself any errors that occur within my ASP.NET application. At one time, I was getting the line numbers of the exceptions. I realize the performance hit but it is ok while I am testing deployment in new environments. Lately I have not been able to get the line numbers any more which makes the error too ambiguous. I have my build configurations to active debug, and in the web.config compilation debug is true.

    For libraries I call from the web app, I have the pdb files deployed into the bin folder. Does anyone know anything more I can check/do to try and get the exception to include the line number? I am using fixed name single page assemblies if that matters.



    I'm not familiar with how to set this up for web remote deployments, but if you have control over what shows up in the email, then look at

    System.Exception.StackTrace

    it's part of the exception object, and it should hold the stack trace and line numbers (if they are available).

  • User profile image
    JParrish

    ScanIAm wrote:
    
    I'm not familiar with how to set this up for web remote deployments, but if you have control over what shows up in the email, then look at

    System.Exception.StackTrace

    it's part of the exception object, and it should hold the stack trace and line numbers (if they are available).


    Thanks.. but yes the template formatting the email includes the full stack trace, which would contain the line number. That is the part I don't understand, it should show me the line number since it was compiled for debug and symbols for other libraries are there. Expressionless

  • User profile image
    Sven Groot

    Is debugging enabled in the web.config? If not it might not load the symbols.

  • User profile image
    JParrish

    Sven Groot wrote:
    Is debugging enabled in the web.config? If not it might not load the symbols.


    Sven.. I have the debug attribute set to true for the compilation section. Is there somewhere else I should look? Thanks

  • User profile image
    stevo_

    Tried a rebuild? I've noticed sometimes the pdb is ignored only for a rebuild to make it start working again.

  • User profile image
    littleguru

    stevo_ wrote:
    Tried a rebuild? I've noticed sometimes the pdb is ignored only for a rebuild to make it start working again.


    Clean solution, rebuild is very useful in some cases...

  • User profile image
    DickB

    Checked whether the .pdb files are actually in there?

  • User profile image
    jh71283

    DickB said:
    Checked whether the .pdb files are actually in there?
    nearly a year ago dude....


    EDIT


    over a year ago dude...

  • User profile image
    Zambonilli

    jh71283 said:
    DickB said:
    *snip*
    nearly a year ago dude....


    EDIT


    over a year ago dude...
    If you use the visual studio publish feature make sure the Emit debugging information checkbox is checked.  

  • User profile image
    Jitu

    JParrish said:
    ScanIAm wrote:
    
    I'm not familiar with how to set this up for web remote deployments, but if you have control over what shows up in the email, then look at

    System.Exception.StackTrace

    it's part of the exception object, and it should hold the stack trace and line numbers (if they are available).


    Thanks.. but yes the template formatting the email includes the full stack trace, which would contain the line number. That is the part I don't understand, it should show me the line number since it was compiled for debug and symbols for other libraries are there. Expressionless
    test..

  • User profile image
    pmatsinopou​los

    hi,
    did you find answer to this problem?
    I have the same problem

  • User profile image
    atitpatel

    One reason i know is that your identity impersonation is set to true in your web.config.

    Turn to false and you will see it.

  • User profile image
    Drevis

    atitpatel said:

    One reason i know is that your identity impersonation is set to true in your web.config.

    Turn to false and you will see it.

    i have the same problem! Sad

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.