473,396 Members | 1,877 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

unhandled exception

Hi,
I made a handler for unhandled errors. But before that is executed, VB.NET
gives me the standard error window. In VB6 there was a setting
(errortrapping) about handling errors
in the design environment and classes, which should prevent the before
mentioned behaviour. Does VB.NET have a setting like it? Or is there
something else?

Thanks in advance
Frank

Nov 20 '05 #1
4 2381
If your talking about type of global error handler for a forms code, you
could try launching the form inside a try catch block.

OHM

"Frank" <fr***@frank.com> wrote in message
news:ca**********@news2.tilbu1.nb.home.nl...
Hi,
I made a handler for unhandled errors. But before that is executed, VB.NET gives me the standard error window. In VB6 there was a setting
(errortrapping) about handling errors
in the design environment and classes, which should prevent the before
mentioned behaviour. Does VB.NET have a setting like it? Or is there
something else?

Thanks in advance
Frank

Nov 20 '05 #2
* "Frank" <fr***@frank.com> scripsit:
I made a handler for unhandled errors. But before that is executed, VB.NET
gives me the standard error window. In VB6 there was a setting
(errortrapping) about handling errors
in the design environment and classes, which should prevent the before
mentioned behaviour. Does VB.NET have a setting like it? Or is there
something else?


How did you make this error handler? Did you add a handler to
'Application.ThreadException'?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #3
Frank,
I made a handler for unhandled errors. But before that is executed, VB.NET gives me the standard error window. Where & how did you "made a handler for unhandled errors"?

Depending on the type of application you are creating, .NET has three
different global exception handlers.

For ASP.NET look at:
System.Web.HttpApplication.Error event
Normally placed in your Global.asax file.

For console applications look at:
System.AppDomain.UnhandledException event
Use AddHandler in your Sub Main.

For Windows Forms look at:
System.Windows.Forms.Application.ThreadException event
Use AddHandler in your Sub Main.

It can be beneficial to combine the above global handlers in your app, as
well as wrap your Sub Main in a try catch itself.

There is an article in the June 2004 MSDN Magazine that shows how to
implement the global exception handling in .NET that explains why & when you
use multiple of the above handlers...

http://msdn.microsoft.com/msdnmag/is...T/default.aspx

For example: In my Windows Forms apps I would have a handler attached to the
Application.ThreadException event, plus a Try/Catch in my Main. The
Try/Catch in Main only catches exceptions if the constructor of the MainForm
raises an exception, the Application.ThreadException handler will catch all
uncaught exceptions from any form/control event handlers.
gives me the standard error window. In VB6 there was a setting
(errortrapping) about handling errors
in the design environment and classes, which should prevent the before
mentioned behaviour. Does VB.NET have a setting like it? To have the IDE break on exceptions use "Debug - Exceptions" then select the
"Common Language Runtime Exceptions" node in the tree. Change either the
"When the exception is thrown" or "If the exception is not handled" option
as needed. If you have a global exception handler per above, you will need
to change the "When the exception is thrown" to "Break into the debugger",
as the global handlers is handling the exception!

Note you can expand the "Common Language Runtime Exceptions" tree to change
the settings for specific exceptions...

Hope this helps
Jay
"Frank" <fr***@frank.com> wrote in message
news:ca**********@news2.tilbu1.nb.home.nl... Hi,
I made a handler for unhandled errors. But before that is executed, VB.NET gives me the standard error window. In VB6 there was a setting
(errortrapping) about handling errors
in the design environment and classes, which should prevent the before
mentioned behaviour. Does VB.NET have a setting like it? Or is there
something else?

Thanks in advance
Frank

Nov 20 '05 #4
"Frank" <fr***@frank.com> wrote in message news:<ca**********@news2.tilbu1.nb.home.nl>...
Hi,
I made a handler for unhandled errors. But before that is executed, VB.NET
gives me the standard error window. In VB6 there was a setting
(errortrapping) about handling errors
in the design environment and classes, which should prevent the before
mentioned behaviour. Does VB.NET have a setting like it? Or is there
something else?

Thanks in advance
Frank


In the VS design environment, Click DEBUG menu and select EXCEPTIONS
from the sub menu. This allows you to define what action to take when
an exception is thrown and if it is not handled. You can define
actions for individual exceptions also. Great if you are trying to
track down a specific error in your app
Nov 20 '05 #5

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

Similar topics

7
by: Chuck Hartman | last post by:
I have a Windows service that requests web pages from a site using an HttpWebRequest object. When I try to request a page from an ASP.NET 2 site, I get a WebException with message "The remote...
5
by: Dave Stewart | last post by:
I recently wrote my first Vb.net application, or at least my first complex app since moving up from vb6. When run from the VS.NET IDE, the program shows no errors and runs fine. When the output exe...
5
by: Lucvdv | last post by:
Can someone explain why this code pops up a messagebox saying the ThreadAbortException wasn't handled? The first exception is reported only in the debug pane, as expected. The second (caused by...
5
by: Samuel R. Neff | last post by:
When you have an unhandled exception in vb.net how do you view the exception information in the debugger? In C# the debugger creates a local variable that points to the exception and you can...
0
by: Colmeister | last post by:
I recently read Jason Clark's excellent article on Unhandled Exceptions (http://msdn.microsoft.com/msdnmag/issues/04/06/NET/default.aspx) and have attempted to incorporate the features he talks...
5
by: Simon Tamman {Uchiha Jax} | last post by:
Now this is bugging me. I just released software for a client and they have reported an unhandled stack overflow exception. My first concern is that the entirity of the UI and any threaded...
0
by: Bob | last post by:
If I induce and unhandled exception in my vb.net code for instance using '-- just a simple "object not initialized" exception (should read "as new") Dim x As Specialized.NameValueCollection ...
1
by: Bob | last post by:
In Vs 2005 you have new applicationsEvents.vb I was testing it in a simple app and found that it was easier to implement unhandled exception management tah it was in Vs2003 (vb.net) You can, if you...
4
by: bg_ie | last post by:
Hi, I have the following Program.cs - namespace TestFrameworkApplication { static class Program { /// <summary> /// The main entry point for the application.
5
by: =?Utf-8?B?c3VydHVyeg==?= | last post by:
Hi, I feel like a noob for asking this. When I publish a VB windows application, I want to disable the ability of the the user to continue when there is an unhandled exception. For example,...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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,...
0
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...
0
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
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...

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.