473,320 Members | 2,088 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,320 software developers and data experts.

Bubbling Exceptions thrown in a Remoted Object

Z D
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
Nov 16 '05 #1
3 1403
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]
- mv*@spam.guard.caspershouse.com

"Z D" <no****@nospam.com> wrote in message
news:ey**************@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

Nov 16 '05 #2
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.net/rhurlbut
http://www.securedevelop.net

"Z D" <no****@nospam.com> wrote in message
news:ey**************@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

Nov 16 '05 #3
I have tried this. I have a binary formatter using a tcp channel. The server
is supported by a service so the configuration is
ApplicationServer.exe.config. I have added the lines below but I still get
the message urging me to change the configuration to show more detailed error
information. I would like to see all of the exception information. I am
checking for InnerException and it seems to be null.

Kevin

"Robert Hurlbut" wrote:
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.net/rhurlbut
http://www.securedevelop.net

"Z D" <no****@nospam.com> wrote in message
news:ey**************@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


Nov 16 '05 #4

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

Similar topics

3
by: Z D | last post by:
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...
14
by: dcassar | last post by:
I have had a lively discussion with some coworkers and decided to get some general feedback on an issue that I could find very little guidance on. Why is it considered bad practice to define a...
5
by: Simon Tamman | last post by:
I have an object named DisasterRecovery. The Ctor of this object is this: private DisasterRecovery() { Application.ThreadException+= new...
11
by: pamelafluente | last post by:
Hi guys, When bubbling some exception up to some interface handlers - what is most recommandable: Try 'some code Catch ex As Exception Throw
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...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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.