views:

1457

answers:

1

I can see line numbers in my error logs in our development environment, in which VB.NET 2005 and ASP.NET components are compiled in debug mode, with PDB files copied to the server on deployment.

I don't see line numbers in production, where things are compiled in release mode, and presumably no PDB files are created or deployed? Can someone explain a way to compile and release production-ready components that show the line number in a stack trace? Debug code that works in dev below:

st = New StackTrace(err, True)

For i As Integer = 0 To st.FrameCount - 1
  Dim sf As StackFrame = st.GetFrame(i)
  system.diagnostics.debug.print sf.GetFileLineNumber
Next i
+4  A: 

Take a look at this article. Basically you need to configure your project to still output PDBs even when running in release mode.

Cory Foy