Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Still having problems with exceptions in .NET causing program or thread to end without error

Posted on 2008-11-13
2
Medium Priority
?
171 Views
Last Modified: 2013-11-26
As you can see, the question I'm relating to yielded a long discussion and a lot of good context.  It turns out, I'm running into a similar problem (probably the result of an external .dll also), but I want to know how to *really* avoid/solve it if I can't get rid of the offending .dll.  I'm using VS 2008, and I've also checked to make sure the debug option is turned on for the exception assistant.

In my case, the rogue exception is on a backgroundworker--so the program doesn't even end--the thread just goes away and the user assumes all is OK.  Not good.

I realize that in a perfect world every exception would be coded for and handled with at try/catch block--but in the real world there are times I need to even force an exception because the cost/benefit of coding for that exception is too high vs a real person intervening.

If it *is* a rogue .dll causing the situation, what can I do?  What would be the equivalent of a VB6 'on error goto 0' (the statement that turns off error trapping in VB6)?
0
Comment
Question by:WJoeMoore
2 Comments
 
LVL 10

Accepted Solution

by:
kdwood earned 1500 total points
ID: 22965718
WJoeMoore,

You asked:

What would be the equivalent of a VB6 'on error goto 0' (the statement that turns off error trapping in VB6)?

It think that's the whole point of the Try/Catch block.  You can choose to react to an exception or not.  For example:

Try

   ' Some function or code

Catch ex as exception

   ' Put code in here to handle the error

  '  If I put nothing in here it will ignore error and attempt to continue processing

End try

I might be misunderstanding you, but that's my cents.

Regards,

Keith
0
 

Author Comment

by:WJoeMoore
ID: 22977135
It looks as if when I put the offending .dll call in a try/catch, future uncaught exceptions do throw the program into the exception assistant.

So, I can still use try/catch as appropriate and allow human intervention in places where I deem that appropriate as well.

Even though you didn't provide new information, I know how to work with the situation and code for it.  Thanks.
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question