Is there a way, in VB.NET, to output the current line number in the source code? For example:
Try ' The following line will purposly cause an error Dim BigNum As Int64 Dim LittleNum As Int16 = CShort(BigNum) Catch ex As Exception Dim LineNumber As Integer = <linenumber> ' How do I do this? MessageBox.Show("Error in source code. Line: " + LineNumber) End Try
Is there any way to fill the LineNumber variable in the example above with the actual line number in the source code that caused the error?