Solved

Debug VB.NET program on program deployed PC

Posted on 2006-06-24
4
335 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

774 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