I would like to print out my debug message with line number in VB.net application. I did like this,
Dim st As StackTrace
Dim sf As StackFramee
st = New StackTrac
The compiled assemblies will not have line numbers associated with them. This is not information that is part of the assemblies.
The information is kept in the debugging symbols file - the pdb
file.
From MSDN - StackTrace class:
StackTrace information will be most informative with Debug build configurations. By default, Debug builds include debug symbols, while Release builds do not. The debug symbols contain most of the file, method name, line number, and column information used in constructing StackFrame and StackTrace objects.