Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VS and Lost Errors

Status
Not open for further replies.

seanbo

Programmer
Jun 6, 2003
407
GB
I'm finding recently that when i get an exception, Visual Studio .net always tells me that it occurred at the line 'Application.Run(new Form1());'. this is true from a certain prespective, but not very helpful. how can i make it be a little more presice?
 
use the try,catch,finally statement like this

try
{
the code you want to execute
}
catch(Exception e)
{
MessageBox.Show(e.Message);
}
finally
{
destruction of the object variables that you don't need
}
 
i know how to use try and catch, that's not what i'm asking. how can i make visual studio tell me the correct line number for the location of an error, rather the the line number of 'Application.Run(new Form1());'??
 
Could it be that the error is ocurring in the constructor of your Form1 object? In which case, the error location is correct.

Chip H.
 
i think you can't , i remember that Delphi does the same thing but never know why
 
it's not chip. i know where it's happening. in fact, i can always work it out - but i'd work it out faster if i were told. i'm sure it used to be more precise, i thought that i might have pressed something daft.

javac always used to give fantasticly detailed error reports that detailed the whereabouts of the error in every class involved - a great list of errors, but it was always obvious which one was yours (actually, it probably still does. but not for me, i don't really program any java now).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top