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

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)?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


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:


   ' 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.



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
WJoeMooreAuthor Commented:
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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.