or even this:
'-------------------------
Try

 'your code here

 Catch ex As Exception
  Dim trace As New System.Diagnostics.StackTrace(ex, True)
  Debug.WriteLine("Line: " & trace.GetFrame(0).GetFileLineNumber)
 End Try
'-------------------------

2010/8/24 Cesare Imperiali <[email protected]>:
> have you tried to follow this example?
> http://www.knowdotnet.com/articles/linenumbersinreleasemode.html
>
> 2010/7/29 ѕняєє мα∂α <[email protected]>:
>>
>> hello,
>>        simply manage a counter variable initialized to 0. and increment
>> after each  and every statement, and just print that counter in catch block.
>> I guess it'll work if not please let me know ....
>>
>>
>> Thanks & Regards,
>> Shrinivas Mada,
>>
>>
>>
>>
>> On Wed, Jul 28, 2010 at 10:28 PM, Dr. Leff <[email protected]> wrote:
>>>
>>> I am compiling at the command line with vbc and then running at the
>>> comamnd line.  Is there
>>> a way to get the computer to spit out the line number when there is a
>>> run time error.
>>>
>>> I tried vbc /debug:full and running the guidebug
>>> or debugclr, as per
>>> http://support.microsoft.com/kb/301058
>>>
>>> I get an exception message.  It gives me a stack trace that takes me
>>> back
>>> to Module1.main;  I have only one module and one subroutine.  But it
>>> does
>>> not tell me the line on which the problem occurred.
>>>
>>> I am running Visual Studio 10.
>>>
>>> I searched my entire hard disk for guidebug and debugclr but cannot
>>> find them.
>>>
>>> Dr. Laurence Leff  Western Illinois University, Macomb IL 61455 ||
>>> (309) 298-1315
>>> Stipes 447 Assoc. Prof. of Computer Sci. Pager: 309-367-0787 FAX:
>>> 309-298-2302
>>
>>
>

Reply via email to