Stacktrace with line numbers

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Karsten Grombach

    #1

    Stacktrace with line numbers

    Hi,
    I'm trying to implement a custom error page for testing purposes.
    When an error occurs, I catch it in the global.asax and store it in a
    session object, so that the custom error page can display it.
    so far so good.
    my problem is, that i would like to have a detailed error message like the
    standard asp.net error message with line numbers etc. At the moment i'm just
    getting the methods called...
    This is the code I'm using:
    sb.Append("<br> Stacktrace ")
    sb.Append("<br> " + ex.StackTrace.R eplace(System.E nvironment.NewL ine,
    "<br>"))
    sb.Append("<br> ")
    sb.Append("<br> Error")
    sb.Append("<br> " + ex.ToString().R eplace(System.E nvironment.NewL ine,
    "<br>"))
    sb.Append("<br> ")

    Any ideas??
    Thanks and Regards
    Karsten


  • Tommy

    #2
    Re: Stacktrace with line numbers

    Try Environment.Sta ckTrace()

    Tommy,

    "Karsten Grombach" <karsten.gromba chNO@spamtria.d e> wrote in message news:<#zeZb5KXD HA.2284@TK2MSFT NGP10.phx.gbl>. ..[color=blue]
    > Hi,
    > I'm trying to implement a custom error page for testing purposes.
    > When an error occurs, I catch it in the global.asax and store it in a
    > session object, so that the custom error page can display it.
    > so far so good.
    > my problem is, that i would like to have a detailed error message like the
    > standard asp.net error message with line numbers etc. At the moment i'm just
    > getting the methods called...
    > This is the code I'm using:
    > sb.Append("<br> Stacktrace ")
    > sb.Append("<br> " + ex.StackTrace.R eplace(System.E nvironment.NewL ine,
    > "<br>"))
    > sb.Append("<br> ")
    > sb.Append("<br> Error")
    > sb.Append("<br> " + ex.ToString().R eplace(System.E nvironment.NewL ine,
    > "<br>"))
    > sb.Append("<br> ")
    >
    > Any ideas??
    > Thanks and Regards
    > Karsten[/color]

    Comment

    Working...