Try/Catch seemingly spat the dummy!

  • Thread starter Thread starter Phil Jones
  • Start date Start date
P

Phil Jones

I've got a really weird little thing going on!

I've got a simple little win-forms project that is referencing some class
libraries.

When I write a Try/Catch block within the win-forms project, and an
exception is raised within the class-library the error isn't handled by my
Try/Catch, rather processing stops at the exception within class-library.

eg.

1 Try
2
3 myClassFromOtherAssembly.DoSomethingWithError()
4
5 Catch ex As Exception : msgbox (ex.ToString)
6 End Try

VS.NET launches into the debugger at line 3 displaying the class within the
other assembly where the error was initially thrown - it never gets handled
by my Try/Catch.

The VS.NET Debug ==>/ Exceptions settings are the default in all projects
concerned.

Never seen that before. Is just this Monday morning stupidity???? Does
anyone have a suggestion, or seen this happen before?

Cheers.
===
Phil
 
I've got a really weird little thing going on!

I've got a simple little win-forms project that is referencing some class
libraries.

When I write a Try/Catch block within the win-forms project, and an
exception is raised within the class-library the error isn't handled by my
Try/Catch, rather processing stops at the exception within class-library.

If the library starts a new thread and the exception happens to occur in
this new thread then i think that your try/catch block will not catch it.
 
If the library starts a new thread and the exception happens to occur in
this new thread then i think that your try/catch block will not catch it.
Even if this were the case, the exception would die with the thread unless
the caller hooked into the appdomain unhandled exception.

In your exceptions settings, the default is to attach a debugger if the
exceptions isn't handled. You want to change this to the "continue" option.

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc
 
Back
Top