Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / December 2004

Tip: Looking for answers? Try searching our database.

AppDomain Unhandled exception

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Hagay Lupesko - 02 Nov 2004 10:54 GMT
Hi,

It is possible to hook on the UnhandledException event in the Default app
domain, and that way get notifications about unhandled exceptions in all of
the threads in the win32 process, i.e. all of the App Domains.

Is there a way to know in which AppDomain the exception occured?
Robert Aman - 03 Nov 2004 13:12 GMT
> Hi,
>
[quoted text clipped - 3 lines]
>
> Is there a way to know in which AppDomain the exception occured?

I don't really know if you can attach to events in other domains,
never tried, though I tend to doubt it, but I do know that you could
attach to the event in the same domain the error occurs and raise a
custom error flag of some sort on an object that extends
MarshalByRefObject which would be visible in the other AppDomain.

It's a neat idea, and if you don't mind, I'll probably steal it from
you. :-)

Bob Aman
http://www.rapidcanvas.com
Nadav - 12 Nov 2004 01:48 GMT
This could be done through Win32 API, use DllImport attribute in combination
with SetUnhandledExceptionFilter API, caching exception this way will enable
you to get notifications of system exception such as access violation that
the standart try -- cache dosn't intersept.

P.S.
Maybe there is a managed equivalent...

> > Hi,
> >
[quoted text clipped - 15 lines]
> Bob Aman
> http://www.rapidcanvas.com
David Levine - 12 Nov 2004 03:43 GMT
If you subscribe to the UnhandledException event in the default appdomain
you will get notifications when a UE occurs in any appdomain within that
process. In fact, subscribing to that event in the other appdomains will not
work because they never get called (a bug in the current framework).

However, none of these will get notified about a UE in a Win32 thread that
is outside the managed process. I'm not sure how you'd even do that in a
pure win32 app, let alone a managed app. It doesn't sound like that's what
you want to do, but your phrasing makes that unclear.

> Hi,
>
[quoted text clipped - 4 lines]
>
> Is there a way to know in which AppDomain the exception occured?
rlander [MSFT] - 15 Dec 2004 20:44 GMT
Yes, you can do this, just like you suggest ...

Here is a blog post that I did in response ....
http://hoser.lander.ca/PermaLink.aspx?guid=4d6820a1-c059-44bc-8b2e-84b2c6a61a39
thanks -- rich

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.