473,322 Members | 1,409 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,322 software developers and data experts.

error handling across app domains

Bob
Say I have two app domains, Domain A and Domain B, that I do not want to
pass object references between. Domain A has Assembly A loaded, which
contains a type that inherits from exception. I want to more or less to pass
this exception to Domain B without loading Assembly A in it. I can do this
by passing some strings and then re-throwing an exception, but this seemed
kind of crude. I was thinking of using a serialization helper class, but was
wondering if one wasn't already built in. Or is that overkill? How is this
typically done?

TIA,
Bob

Nov 20 '05 #1
2 1180
Bob,
Have you looked at the AppDomain.UnhandledException?

I have not used it in multiple AppDomain situations, however reading the
help for the above event it sounds like you just need to set a handler in
your startup AppDomain, then any unhandled exception in any app domain will
be handled by this handler...

For an unhandled exception:
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.

Hope this helps
Jay

"Bob" <no****@nowhere.com> wrote in message
news:OF**************@TK2MSFTNGP12.phx.gbl...
Say I have two app domains, Domain A and Domain B, that I do not want to
pass object references between. Domain A has Assembly A loaded, which
contains a type that inherits from exception. I want to more or less to pass this exception to Domain B without loading Assembly A in it. I can do this
by passing some strings and then re-throwing an exception, but this seemed
kind of crude. I was thinking of using a serialization helper class, but was wondering if one wasn't already built in. Or is that overkill? How is this
typically done?

TIA,
Bob

Nov 20 '05 #2
Bob
I'll have a look at that, thanks.

Bob

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Bob,
Have you looked at the AppDomain.UnhandledException?

I have not used it in multiple AppDomain situations, however reading the
help for the above event it sounds like you just need to set a handler in
your startup AppDomain, then any unhandled exception in any app domain will be handled by this handler...

For an unhandled exception:
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.

Hope this helps
Jay

"Bob" <no****@nowhere.com> wrote in message
news:OF**************@TK2MSFTNGP12.phx.gbl...
Say I have two app domains, Domain A and Domain B, that I do not want to
pass object references between. Domain A has Assembly A loaded, which
contains a type that inherits from exception. I want to more or less to

pass
this exception to Domain B without loading Assembly A in it. I can do this by passing some strings and then re-throwing an exception, but this seemed kind of crude. I was thinking of using a serialization helper class, but

was
wondering if one wasn't already built in. Or is that overkill? How is this typically done?

TIA,
Bob



Nov 20 '05 #3

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

Similar topics

1
by: d.schulz81 | last post by:
Hi all, We have about 10 different domains that are linked very closely and we want to identify and keep track of every single user that surfs our websites by the use of sessions. The problem...
2
by: Keon | last post by:
Hoi Is it possible to use cookies between different domains? For my site I use 2 domains; the first for my global site with ASP en HTML the second is for my forum located on "hyperboards" a...
2
by: googleboy | last post by:
I have created a html-page with formelements that via a javascript get their data from an iframe that calls a external XLM-page. The solution works in MS Explorer, but only if the browser security...
1
by: Sean C. | last post by:
Helpful folks, We have been having an intermittent and completely unreproducable problem concerning user authentication on Windows 2000: SQL1403N The username and/or password supplied is...
7
by: Doug | last post by:
An ASP.NET session cookie set on "www.mydomain.com" can not be accessed on "search.mydomain.com"; hence, a new session and cookie are being created on every sub-domain. This is occuring because...
1
by: ozgur uksal | last post by:
hi, Is there any way to upload data across domains? In other words, assume you own two domains on the same server, and the first domain, that your client visits to upload data, is going to be...
35
by: jeffc226 | last post by:
I'm interested in an idiom for handling errors in functions without using traditional nested ifs, because I think that can be very awkward and difficult to maintain, when the number of error checks...
13
by: Samir Chouaieb | last post by:
Hello, I am trying to find a solution to a login mechanism for different domains on different servers with PHP5. I have one main domain with the user data and several other domains that need...
9
by: Josh | last post by:
I run a Joomla website and am familiar with php in some but not all aspects. Currently I am trying to find some solutions related to session handling. Am I correct in saying that "login" is kept...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.