473,761 Members | 6,001 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Global error handler

Hi

Microsoft Visual Studio 2005, Visual Basic and winforms application
I need a global error handler, where should I put that.
Any examples?

TIA

Rodrigo Juarez
Feb 16 '07 #1
3 1549
Rodrigo,

I'm not sure what you mean by global error handler. If you want to put one
in that will catch any error not captured by a *local* Try/Catch structure,
you can put one in ApplicationEven ts.

Exceptions bubble up the call tree until they are handled (or they hit the
top and blow up). The top of the tree is in ApplicationEven ts, where you
can add an event handler for unhandled exceptions.

To get to the ApplicationEven ts, double-click on "My Projects" to bring up
project properties, then select the tab "Applicatio n", and click on the
button "View Application Events".

To see what events you can capture, pull down the left dropdown at the top
and select "(MyApplica tion Events)". Then pull down the right dropdown at
the top. The one you want is UnhandledExcept ion.

There are also events for the application starting up and shutting down,
etc.

Is this what you're looking for?

Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
"Rodrigo Juarez" <ti************ **@newsgroup.no spamwrote in message
news:Ol******** ******@TK2MSFTN GP02.phx.gbl...
Hi

Microsoft Visual Studio 2005, Visual Basic and winforms application
I need a global error handler, where should I put that.
Any examples?

TIA

Rodrigo Juarez

Feb 16 '07 #2
Yes! this is what I looking for

"RobinS" <Ro****@NoSpam. yah.noneescribi ó en el mensaje
news:R6******** *************** *******@comcast .com...
Rodrigo,

I'm not sure what you mean by global error handler. If you want to put one
in that will catch any error not captured by a *local* Try/Catch
structure, you can put one in ApplicationEven ts.

Exceptions bubble up the call tree until they are handled (or they hit the
top and blow up). The top of the tree is in ApplicationEven ts, where you
can add an event handler for unhandled exceptions.

To get to the ApplicationEven ts, double-click on "My Projects" to bring up
project properties, then select the tab "Applicatio n", and click on the
button "View Application Events".

To see what events you can capture, pull down the left dropdown at the top
and select "(MyApplica tion Events)". Then pull down the right dropdown at
the top. The one you want is UnhandledExcept ion.

There are also events for the application starting up and shutting down,
etc.

Is this what you're looking for?

Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
"Rodrigo Juarez" <ti************ **@newsgroup.no spamwrote in message
news:Ol******** ******@TK2MSFTN GP02.phx.gbl...
>Hi

Microsoft Visual Studio 2005, Visual Basic and winforms application
I need a global error handler, where should I put that.
Any examples?

TIA

Rodrigo Juarez


Feb 16 '07 #3
Hi Rodrigo,

Glad to see your problem is resolved. Below is some more information:

Actually, VB2005 UnhandledExcept ion encapsulates .Net Winform
Application.Thr eadException. .Net provided 3 different types of global
error handler for unhandled exceptions based on the application types.

..Net Winform -- Application.Thr eadException event
..Net Console -- AppDomain.Unhan dledException event
Asp.net -- HttpApplication .Error event, which is defined in Global.asax as
Application_Err or method.

Please refer to the article below:
"Unexpected Errors in Managed Applications"
http://msdn.microsoft.com/msdnmag/issues/04/06/NET/

Hope this helps.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

Feb 18 '07 #4

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

Similar topics

2
6964
by: VM | last post by:
Is it possible to intercept all exception errors into one Try...Catch? I've tried wrapping Application.Run() in a Try...Catch, but it doesn't seem to work all the time. Thanks.
3
3039
by: tafs7 | last post by:
My code below is supposed to email me when an error occurs on the application, but it's not emailing anything. Am I missing something? I know the smtp servers I've tried work. I even added a App_Start handler to see if I could get emailed at all even from the first request of the app, but to no avail. Could someone please help me out? Thanks a lot! --Thiago Web developer AgniTEK
0
1604
by: Mark | last post by:
There appear to be several ways to get the global error handler in global.asax.cs to fire repeatedly in a nasty endless loop. Is there a way to keep this event from firing only a handful of times over the course of a minute, so that if it's obviously caught in a vicious loop, it will stop? In our global error handler, we send an email warning developer's of the problem. However, if the global error handler fires repeatedly, we get...
6
670
by: fd123456 | last post by:
Er... Sorry to interrupt, but you CAN put methods and functions in the Global.asax file. You just have to make them static (Shared in VB). You can even use functions normally not available outside of a page, like LoadControl, like this : in an aspx code-behind file, for instance in the Page_Load handler : System.Web.UI.Page p = this; bool IsLoaded = Global.GlobalMethod(ref p);
2
2350
by: tshad | last post by:
I have my error handling set up in Global.asax: Sub Application_Error(Sender As Object, E as EventArgs) In this procedure I call a function in a dll that will write out to a history file. This works for some errors, but not others. If it doesn't work, it stops there and the normal MS error page goes to the User.
0
2480
by: hynek.cihlar | last post by:
A strange behaviour thatI found in ASP.NET 2.0. I am trying to issue a callback request (handled by ICallbackEventHandler and RaiseCallbackEvent) and a regular GET request in the client browser and handle them at the same time - in parallel. The funny thing is that the behaviour of the implementation I created depends on the existence of Global.asax in the Web application. Here is the source of the page that handles the regular GET...
2
1930
by: yeghia \(sosy\) | last post by:
Hi Guys I have two questions. 1. Is there a way to set a handler to .NET application so that in case of not caught exception my handler is called before application shutdown. I want to send an email from this handler with details of error. 2. Is there a way to capture the text (with stack frame etc) displayed in a dialog which is shown when unhandled execption is thrown Thanks in advance for your help
7
1686
by: Jason Kester | last post by:
Best I can tell, there are three basic ways you can deal with global error handling in ASP.NET. Namely: 1. Derive all your pages from a custom Page class, and override OnError() 2. Specify a custom 500 handler in Web.Config 3. Specify a custom 500 handler in IIS
20
12760
by: teddysnips | last post by:
Weird. I have taken over responsibility for a legacy application, Access 2k3, split FE/BE. The client has reported a problem and I'm investigating. I didn't write the application. The AutoExec macro calls a function "InitApplication" which, in turn, calls a function to set the value of a global string variable
0
9531
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9345
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
9957
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
9905
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
9775
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...
0
8780
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5229
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...
1
3881
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 we have to send another system
3
2752
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.