UnhandledExceptionHandler delegate not working in remoting host
From: Ian Tompsett (anonymous_at_discussions.microsoft.com)
Date: 02/10/04
- Next message: Ian Tompsett: "RE: Remote method returning an object"
- Previous message: Redmoon: "Re: Can the .net remoting tech. adapt to the p2p application?"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 9 Feb 2004 21:46:07 -0800
Hi
I'm trying to use AppDomain's UnhandledExceptionEventHandler in my remoting host console app. The console app is very simple - it just loads a remoting configuration file and then sits there allowing requests to go through to various remotable classes in some other assemblies that it references. This all seems to work happily.
But I'd like to catch any unhandled exceptions that occur in any of the actual assemblies being used by client applications (so I can log them and then throw them again for consumption in the client apps).
So just before the call to RemotingConfiguration.Configure, I've added a delegate to handle
AppDomain.CurrentDomain.UnhandledException. I've then forced an exception to occur in one of the assemblies. This exception is being raised - it's getting back to the client application - but my UnhandledException delegate isn't being called.
Is there something else I should do? I've put the code below...
Thanks
//By the way, does it matter if I add the STAThread attribute or not?
[STAThread]
static void Main(string[] args)
{
AppDomain currDomain = AppDomain.CurrentDomain;
currDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
RemotingConfiguration.Configure ("RemoteHost.exe.config");
Console.WriteLine ("Press Enter to terminate...");
Console.ReadLine ();
}
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
Console.WriteLine("Exception occurred");
}
- Next message: Ian Tompsett: "RE: Remote method returning an object"
- Previous message: Redmoon: "Re: Can the .net remoting tech. adapt to the p2p application?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|