Help - Can't pinpoint unhandled exception that makes client crash and server hang

Greetings,

I am using .NET 2.0 / C# and have a client/server setup with remoting. The server entertains about 25 clients, and from time to time I will get an unhandled exception in my client that pops up the Windows Error Reporting dialog box, and thus makes my server hang because in the server I have it sift through my clients from time to time to make sure they are not disconnected or otherwise not active.

Things I have done to catch this error and try to log it some how...

- In the client console app, the entire Main has a try/catch. Even methods of the client object that the server calls has a try/catch. I have basically try/catch'ed anywhere I can think of - no luck

- In the client app I use Thread.GetDomain().UnhandledException to trap the error - no luck

I understand if the error is from another thread, I can not trap it via a standard try/catch - but any ideas on how to beat this thing?

The error is very intermittent - it is not 'always' reproducable. I can go a day without it and then get 5 of them in 15 minutes. No rhyme or reason - I try to create the scenario with the same data being used by the server/client but no luck.

So my main question is how to effectively trap this error that seems to be untrappable? I can't even get my hands on it - so that makes it difficult to try and diagnose it.

Any ideas would be helpful - I am not a remoting guru by an means, so I am hoping someone will suggest something pretty standard that I just have not done yet...

Thanks!

[1560 byte] By [Cable] at [2007-12-24]
# 1

At the risk of asking the most obvious, did you try attaching a debugger? windbg, cordbg or vs?

Thanks

SowmySrinivasan at 2007-8-31 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 2
Well that is the thing - I can never reproduce this error it is so random. It only happens on the production server. Can I upload to the production server and use debug code and attach one of those tools to it on the production server when it prompts me if I wish to debug?
Cable at 2007-8-31 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...

.NET Development

Site Classified