473,487 Members | 2,698 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Centrelized Exceptions Catching?

Hi everyone.

I have an application that consumes several class libraries all written in
C#.

some of these DLL's are still buggy and produce exceptions. the application
is in its beta stage and therefor users are currently using it.

is there a way to avoid the built-in runtime exception handler and create a
mechanisem to collect the exception info and then lets say put it on a
Database? (exception can occur on the application, or any nested DLL in the
references path)

furthermore, when users get these messages, I instruct them to send me the
content of the message which is often usless since it does not contain line
numbers inside the code like it does in debug time, and it is almost
impossible for me to "recreate" the bug because the users dont allways
remember what they did prior to the exception...
so:
1. can I make the CLR show the line numbers (relaesing debug info in a way)?
2. can I recreate object states to recreate the situation leading to the
exception using info attached to the exception?

Thanx,

Picho
Nov 16 '05 #1
3 1023
Hi Picho
One I idea I just got it to a append the line number of the start of the
try to the catch to the exception message. Since you already had those in
Visual studio you can hardcode them to appear into your message
For example

102: try {


107 : }Catch ( Exception e){
MessageBox.Show("error in lines 102 to 107 : " + e.Message) ;
}
hope this helps
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Nov 16 '05 #2
You might want to look at the Application.ThreadException event. That
will catch almost all exceptions that are not handled (excluding some
internal ones).

HTH
Kieran

mo************@egdsc.microsoft.com (Mohamoss) wrote in message news:<Br**************@cpmsftngxa06.phx.gbl>...
Hi Picho
One I idea I just got it to a append the line number of the start of the
try to the catch to the exception message. Since you already had those in
Visual studio you can hardcode them to appear into your message
For example

102: try {


107 : }Catch ( Exception e){
MessageBox.Show("error in lines 102 to 107 : " + e.Message) ;
}
hope this helps
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Nov 16 '05 #3
"Picho" <pi***********@telhai.ac.il> wrote in message
news:eE****************@TK2MSFTNGP10.phx.gbl...
Hi everyone.

I have an application that consumes several class libraries all written in
C#.

some of these DLL's are still buggy and produce exceptions. the application is in its beta stage and therefor users are currently using it.

is there a way to avoid the built-in runtime exception handler and create a mechanisem to collect the exception info and then lets say put it on a
Database? (exception can occur on the application, or any nested DLL in the references path)

furthermore, when users get these messages, I instruct them to send me the
content of the message which is often usless since it does not contain line numbers inside the code like it does in debug time, and it is almost
impossible for me to "recreate" the bug because the users dont allways
remember what they did prior to the exception...
so:
1. can I make the CLR show the line numbers (relaesing debug info in a way)? 2. can I recreate object states to recreate the situation leading to the
exception using info attached to the exception?


You can open the Properties of the project and change the Release build to
include debug information. This will get you the line numbers. You should
also look into System.Application.ThreadException and
System.AppDomain.UnhandledException which let you set last chance condition
handlers.
Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2965
by: Rolf | last post by:
I understand a compilation error occurs when a method that throws no exceptions is the only code in a try block. What I don't understnad is why I can specify the catching of an Exception for a...
1
2175
by: Vegard Bakke | last post by:
From whet I can see, Python documentation is lacking a very important piece of information. Very few functions have documented what exceptions they raise, and under what cicumstances. Is this a...
26
2607
by: Zunbeltz Izaola | last post by:
Hi, I've the following problem with try/exception. I've a try block that will raise some exceptions. I want the program to ignore this exceptions completely. Is it possible? Thanks in...
24
2236
by: annex | last post by:
hi, i have some queries about handling exceptions, i'm using Borland c++ Builder 6. 1) what's the best way to catch multiple exceptions in one catch statement? is this possible? for e.g i want...
9
343
by: Steven Blair | last post by:
Hi, I need to catch exceotions on File.Delete() After checking the help, I have noticed that thgere are serevral Exceptions that can be thrown. My question is, should I catch all thes...
6
2813
by: RepStat | last post by:
I've read that it is best not to use exceptions willy-nilly for stupid purposes as they can be a major performance hit if they are thrown. But is it a performance hit to use a try..catch..finally...
7
2311
by: cmay | last post by:
FxCop complains every time I catch System.Exception. I don't see the value in trying to catch every possible exception type (or even figuring out what exceptions can be caught) by a given block...
12
6086
by: Vasco Lohrenscheit | last post by:
Hi, I have a Problem with unmanaged exception. In the debug build it works fine to catch unmanaged c++ exceptions from other dlls with //managed code: try { //the form loads unmanaged dlls...
5
2209
by: Simon Tamman | last post by:
I have an object named DisasterRecovery. The Ctor of this object is this: private DisasterRecovery() { Application.ThreadException+= new...
0
7106
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6967
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7181
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6846
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7349
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5442
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1381
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
267
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.