473,763 Members | 3,712 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

application level error catch

Is there a straight forward way to tell .net to log any unhandled errors in
the application log. I am catching and logging in certain locations but its
the surprise errors that I need to log the information from. I know how to
log using a try-catch block but i need something for any unforseen error
since my users do not report the description and location correctly.

Thanks for any help.
Oct 26 '05 #1
4 1519
You could use Application_Err or. See :
http://support.microsoft.com/default...22120121120120
--
Patrice

"tjfdownsou th" <tj**********@d iscussions.micr osoft.com> a écrit dans le
message de news:B3******** *************** ***********@mic rosoft.com...
Is there a straight forward way to tell .net to log any unhandled errors in the application log. I am catching and logging in certain locations but its the surprise errors that I need to log the information from. I know how to log using a try-catch block but i need something for any unforseen error
since my users do not report the description and location correctly.

Thanks for any help.

Oct 26 '05 #2
Thanks Patrice, but I am using a windows application not a web app. I
thought any errors not handled would get written to the event viewer but they
do not. For instance at some random place I get a connection timeout or an
input error, etc. I would like to be able to record that somewhere.

Thanks

"Patrice" wrote:
You could use Application_Err or. See :
http://support.microsoft.com/default...22120121120120
--
Patrice

"tjfdownsou th" <tj**********@d iscussions.micr osoft.com> a écrit dans le
message de news:B3******** *************** ***********@mic rosoft.com...
Is there a straight forward way to tell .net to log any unhandled errors

in
the application log. I am catching and logging in certain locations but

its
the surprise errors that I need to log the information from. I know how

to
log using a try-catch block but i need something for any unforseen error
since my users do not report the description and location correctly.

Thanks for any help.


Oct 27 '05 #3
Oups sorry...

I started few weeks ago my first .NET Windows application and I'm using the
Application.Thr eadException event :
http://msdn.microsoft.com/library/de...ptiontopic.asp

--
Patrice

"tjfdownsou th" <tj**********@d iscussions.micr osoft.com> a écrit dans le
message de news:67******** *************** ***********@mic rosoft.com...
Thanks Patrice, but I am using a windows application not a web app. I
thought any errors not handled would get written to the event viewer but they do not. For instance at some random place I get a connection timeout or an input error, etc. I would like to be able to record that somewhere.

Thanks

"Patrice" wrote:
You could use Application_Err or. See :
http://support.microsoft.com/default...22120121120120

--
Patrice

"tjfdownsou th" <tj**********@d iscussions.micr osoft.com> a écrit dans le
message de news:B3******** *************** ***********@mic rosoft.com...
Is there a straight forward way to tell .net to log any unhandled errors
in
the application log. I am catching and logging in certain locations
but its
the surprise errors that I need to log the information from. I know
how to
log using a try-catch block but i need something for any unforseen

error since my users do not report the description and location correctly.

Thanks for any help.


Oct 27 '05 #4
Subscribe to the Appdomain.Unhan dledException event and log it from there.
If you do not handle it then you get the default behavior of the runtime,
which does not log it. For a windows app or asp.net you will also need to
subscribe to the Application.Thr eadException and the
Web.HttpApplica tion.Error event to get all exceptions.

In general you should write the code so you never get a UE. In the shipping
version of the runtime (v1.1) a UE does not cause the app to terminate; in
future versions the app will terminate after a UE has been processed.

"tjfdownsou th" <tj**********@d iscussions.micr osoft.com> wrote in message
news:B3******** *************** ***********@mic rosoft.com...
Is there a straight forward way to tell .net to log any unhandled errors
in
the application log. I am catching and logging in certain locations but
its
the surprise errors that I need to log the information from. I know how
to
log using a try-catch block but i need something for any unforseen error
since my users do not report the description and location correctly.

Thanks for any help.

Oct 28 '05 #5

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

Similar topics

3
1803
by: Marc Robitaille | last post by:
hello, How can I have the path of my web application from the global.asax.vb ? I need the path because I have to create an xml file when the application start. thank you Marc R.
5
1531
by: Jason MacKenzie | last post by:
I have a production critical windows forms application. I have try catch blocks everywhere to handle every eventuality. However occasionally, every couple of months, the application crashes. Its usually a .Net Framework error message telling me there was an unhandled exception An example would be last October when the clocks rolled back. My question is: is there a way to handle an exceptions that might make it through the error...
2
3048
by: Lucas Tam | last post by:
Without writing try/catch statements is there a way to have a global error handler in VB.NET? In ASP.NET there is an application level error handler inside Global.asax, but is there something similar for VB.NET winform programs? Thanks! -- Lucas Tam (REMOVEnntp@rogers.com) Please delete "REMOVE" from the e-mail address when replying.
5
2382
by: | last post by:
I've created a small vb.net application which uses the Data Access Application Block to access a SQL Server 2000 database. The application works fine on the machine with the development environment (Windows 2K) but I am unable to get it to work on two other machines (Windows XP machines). When I try running the application on these machines I get a message box, after some delay, that says "Application has generated an exception that could...
1
1980
by: metsys | last post by:
We have an ASP.NET 2.0 (C#) application that is divided into multiple layers. The multiple layers come from having a web project and 2 different class library projects in the same solution. I'm having difficulties figuring out the best way to handle (catch) exceptions in the different layers and then propagating those errors back up through the call stack to ultimately display something to the end-user. Note this is an intranet...
8
1299
by: Rob Meade | last post by:
Hi all, Ok - typically, in a function that returns as a boolean, if there's a bit of database action going on I'll have a little tidy up process before exiting the function. I know .net is supposed to handle all of this stuff itself, but its a practice I've always performed, and personally I like to know its been done! So, as an example I'd have a little something like this..
4
2179
by: David Lozzi | last post by:
Howdy, I found a nice little book called ASP.NET 2.0 Cookbook by Michael A Kittel and Geoffrey LeBlond. Anyway, they have some instructions on how to setup application level error handling. Most of my functions have try..catch to email me about an error, then I want the application level to fire off to send the user to a custom page AND log it in the app log. When an error occurs on my page, i get a server error Server Error in...
0
3603
by: David Lozzi | last post by:
Howdy, I'm working on some error handling for my application. Currently on WinXP Pro SP2. Basically this is what I'm doing: Try...Catch at the method level, Catch sends email with error Page_error has code: Throw Server.GetLastError
4
3212
by: dave m | last post by:
I'm creating a class library (dll) and am confused as how to pass any information, should any exceptions occur, back to the calling application. Such as: Try x = 3 / 0 ' divide by 0 error Catch ex as Exception '(how do I pass ex info back to calling app?) End Try
25
2372
by: JJ | last post by:
I only want to catch 404 errors at the application level (the rest are will be handled by the customerrors section of the web.config). How do I check for the error code in the Application_Error of Global.asax ? Thanks, JJ
0
9386
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10145
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9998
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9938
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9822
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7366
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2793
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.