I am using Server.GetLastError() to get error details for logging, which is fine, but what I really need is the actual line of code that caused the error.

If you don't have a custom error page, it shows you the actual line that caused the error but I can't seem to find it in the Server.GetLastError() object.

I have noticed that the following code gets me the name of the procedure in which the error occurred:
VB Code:
  1. appException = Server.GetLastError()
  2. MsgBox(appException.TargetSite.Name)
But not the actual line of code that triggered the error.