Solved

Debug VB.NET program on program deployed PC

Posted on 2006-06-24
4
322 Views
Last Modified: 2010-04-23
When I developed program with VB.NET and I can test out or debug the program. That's easy to know where ever it has bug or error. But after building (compiling) it, I deploy to other PC (where it does not have VB development software installed). And when I run the program and if it found error. My issue is that how can I know which program line created the error. In other word, how I trace program running steps.

Any recommendation ? Please !
0
Comment
Question by:mpitak
  • 3
4 Comments
 
LVL 14

Expert Comment

by:ptakja
ID: 16976048
If you deploy the program under a DEBUG build, then any exceptions that are thrown will contain the line numbers in the exception.StackTrace property.

I wrote an error logger component that I use to log application errors, trace messages, informational messages, etc... to a log file on the local PC as well as a database.

You can also log messages to the Windows Event Log with a single line of code. I don't remember the exact syntax, but it is something like EventLog.WriteEntry().

So in your code you could have something like this:

Try
   <put your code here that could throw an exception>
Catch ex As Exception
   Call EventLog.WriteEntry(String.Format("{0}{1}{1}{2}", ex.Message, Environment.Newline, ex.StackTrace))
End Try

0
 

Author Comment

by:mpitak
ID: 17022953
Hello ptakja,

As your suggestion, it will start capturing log after 'Try' command. Can I have log from program started until it's end.
0
 
LVL 14

Expert Comment

by:ptakja
ID: 17023936
Sure. You can call the EventLog.WriteEntry routine anytime to log messages.
0
 
LVL 14

Accepted Solution

by:
ptakja earned 50 total points
ID: 17023937
However, you can't get stack trace information except when an exception is thrown.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now