[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

Client trying to access to unactivated objects

le_khan

7/9/2004 4:57:00 PM

Hi NG

I've got another issue in my remoting application.

I want to catch and manage the exception thrown when a client try to
access to the remote objects whereas the server is not lauched.
This exception is a 'System.Net.WebException'
The message is "The underlying connection was closed: Unable to
connect to the remote server"

I added a try-catch block around the Activator.GetObject call, but the
exception is not cought at all.
It is cought in the main entry point of the application.
But after running the command of my catch block (typically a
MessageBox,Show() ), the application closes.

Is someone able to highlight me on how to manage this kind of
exception and avoid the application to exit?

thank you
k
2 Answers

Ken Kolda

7/9/2004 5:16:00 PM

0

The problem is that the exception will be raised when you first attempt to
access the remote object. One option is to immediately invoke a
method/property (such as ToString()) after calling GetObject() and catch the
exception from that call.

Ken


"k a" <le_khan@yahoo.fr> wrote in message
news:8f1b5e2a.0407090857.551bbe6@posting.google.com...
> Hi NG
>
> I''ve got another issue in my remoting application.
>
> I want to catch and manage the exception thrown when a client try to
> access to the remote objects whereas the server is not lauched.
> This exception is a ''System.Net.WebException''
> The message is "The underlying connection was closed: Unable to
> connect to the remote server"
>
> I added a try-catch block around the Activator.GetObject call, but the
> exception is not cought at all.
> It is cought in the main entry point of the application.
> But after running the command of my catch block (typically a
> MessageBox,Show() ), the application closes.
>
> Is someone able to highlight me on how to manage this kind of
> exception and avoid the application to exit?
>
> thank you
> k


k a

7/12/2004 9:47:00 AM

0

Thanks for your help ken!




*** Sent via Devdex http://www.... ***
Don''t just participate in USENET...get rewarded for it!