[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

microsoft.public.dotnet.framework.remoting

Bubbling Exceptions thrown in a Remoted Object

unknown

10/29/2004 7:37:00 PM

Hello,

I have a remoted object which throws an exception if something goes bad. eg:
throw new Exception("Something went wrong.");

When I test the assembly locally on my machine (without remoting), things
work fine.

However, once I remote the object, whenever an exception is thrown, I ALWAYS
get the same generic exception in my try/catch block:

{System.Runtime.Remoting.RemotingException}
The message is: {Server encountered an internal error. For more
information, turn on customErrors in the server's .config file"}



Any usggestions? I've tried setting CustomErrors=on/remoteOnly/off in
web.config but it doesn't change anything.

Note: I'm using HTTP/binary remoting via IIS.


Any suggestions/assistance would be greatly appreciated. Thanks!

-ZD


2 Answers

Nicholas Paldino [.NET/C# MVP]

10/29/2004 7:48:00 PM

0

Z D,

Have you checked the InnerException property? Because the exception
happens on another machine (and something could go wrong with the remoting
plumbing which would throw an exception) any exceptions that occur on the
server side are wrapped in a RemotingException, to distinguish the
exceptions that are thrown as a result of plumbing, instead of your code.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com

"Z D" <nospam@nospam.com> wrote in message
news:eyNOy8evEHA.2316@TK2MSFTNGP15.phx.gbl...
> Hello,
>
> I have a remoted object which throws an exception if something goes bad.
> eg:
> throw new Exception("Something went wrong.");
>
> When I test the assembly locally on my machine (without remoting), things
> work fine.
>
> However, once I remote the object, whenever an exception is thrown, I
> ALWAYS get the same generic exception in my try/catch block:
>
> {System.Runtime.Remoting.RemotingException}
> The message is: {Server encountered an internal error. For more
> information, turn on customErrors in the server's .config file"}
>
>
>
> Any usggestions? I've tried setting CustomErrors=on/remoteOnly/off in
> web.config but it doesn't change anything.
>
> Note: I'm using HTTP/binary remoting via IIS.
>
>
> Any suggestions/assistance would be greatly appreciated. Thanks!
>
> -ZD
>


Robert Hurlbut

10/30/2004 9:43:00 PM

0

Z D,

The correct setting is:

<system.runtime.remoting>
<customErrors mode="off"/>
...
</system.runtime.remoting>

in the web.config on the remote/server side.

Also, are you throwing any custom exceptions? If so, you need to make sure
the custom exception is also defined and referenced on both sides of the
wire (client and server) in order for the exception to serialize and
deserialize properly.

Robert Hurlbut
http://weblogs.asp.ne...
http://www.secured...

"Z D" <nospam@nospam.com> wrote in message
news:eyNOy8evEHA.2316@TK2MSFTNGP15.phx.gbl...
> Hello,
>
> I have a remoted object which throws an exception if something goes bad.
> eg:
> throw new Exception("Something went wrong.");
>
> When I test the assembly locally on my machine (without remoting), things
> work fine.
>
> However, once I remote the object, whenever an exception is thrown, I
> ALWAYS get the same generic exception in my try/catch block:
>
> {System.Runtime.Remoting.RemotingException}
> The message is: {Server encountered an internal error. For more
> information, turn on customErrors in the server's .config file"}
>
>
>
> Any usggestions? I've tried setting CustomErrors=on/remoteOnly/off in
> web.config but it doesn't change anything.
>
> Note: I'm using HTTP/binary remoting via IIS.
>
>
> Any suggestions/assistance would be greatly appreciated. Thanks!
>
> -ZD
>