Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
i have a project in which i have many classes including forms. the problem that i have is when a error is caught, i should be able to find the class in which the error occured and method in which it occured. should i use the asembly if s how ??
  • Administrators
Posted

If you just need access to these details for display or logging purposes then you can use the excepetion's StackTrace property like :

       Try
           Dim i As Integer
           Dim s As String = "Fred"
           i = s
       Catch ex As Exception
           MessageBox.Show(ex.StackTrace)
       End Try

 

If you require programatic access then if you could give a little more detail about how your code is organised / what you are trying to do then we can offer more help.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

I apreciate ur relpy but what i want is the exact class name and the method name. stackTrace is givin umnecssary details.

 

for example u can use the application.name to find the application where the error occured

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...