how to print out line number during application run in VB.net

后端 未结 3 411
死守一世寂寞
死守一世寂寞 2021-01-24 22:32

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         


        
3条回答
  •  走了就别回头了
    2021-01-24 23:23

    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.

提交回复
热议问题