new to debug... howto save debug to file

G

Guest

Hi!

When developing a windows application I sometimes recieve a popup wnidow
with an exception message. (telling me somthing about JIT... with following
error message)

When this exceptions occurs I whish that the applications should save it to
a file, as a log.

How do I do that, or where do I find info about it?
(It is impossible/overwhelming to write try / catch for every event in the
application)
 
B

Bruce Wood

You don't write a try...catch for every exception in the application.
Exceptions percolate up the call stack until they reach the main
program (generally speaking).

You just need to trap exceptions at a few places to "get them all",
then you can call a logging routine in those few places.

I haven't done it myself (I need to do it soon). However, there is this
article

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp08162001.asp

that may be a good place to start.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top