I am writing code in
VB from Visual Studio 2005 Standard Edition. I find it really nice that a Try...Catch exception actually provides the line number in which the exception occurred.
I wanted to know if the line number was also displayed in a compiled, excuse me, a published program. I created a simple program with a form and no controls. The Form_Load procedure has an intentional error.
Here is the code.
Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim x As Long = 64000
MessageBox.Show(x.ToString)
Try
Dim y = CShort(x)
MessageBox.Show(y.ToString)
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
End Sub
When I run the program in the
VB environment it works fine and tells me there is an error in Line 7 {Dim y = CShort(x)}.
Unfortunately, after I publish the program and run it, I get an Unhandled exception...
StartIndex cannot be less than zero.
Parameter name: startIndex
I have not been able to find any information on what this (startIndex) is, where it is, or what to do about it. Any help would be appreciated.
Thanks, Lowell