Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Debug VB.NET program on program deployed PC

Posted on 2006-06-24
4
Medium Priority
?
347 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 200 total points
ID: 17023937
However, you can't get stack trace information except when an exception is thrown.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

971 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