473,403 Members | 2,071 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,403 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 21 '05 #1
3 2550
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 21 '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 21 '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 21 '05 #4

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

Similar topics

26
by: OvErboRed | last post by:
I just read a whole bunch of threads on microsoft.public.dotnet.* regarding checked exceptions (the longest-running of which seems to be <cJQQ9.4419 $j94.834878@news02.tsnz.net>. My personal...
24
by: mag31 | last post by:
Is there any way to find out if a particular .net function will throw an exception without first generating the exception? I am using structured exception handling i.e. try catch finally blocks...
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...
3
by: Robert Rotstein | last post by:
It appears that exception handling at the top-most level of a C# program, in the static void Main() method, differs depending on whether the program is run in debug mode or not. That is, code such...
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...
3
by: Grant Schenck | last post by:
Hello, I have a Windows Service developed in C# .NET. I'm making it a remote server and I can, via an IPC Channel, expose methods and call them from a client. However, I now want my remoted...
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
2
by: Chuck Bowling | last post by:
In studying for the 70-316 I ran across the question below. I'm a little confused by the 'correct' answer. Why is it necessary to wrap the Validate method in a try/catch block? Doesn't the...
0
RedSon
by: RedSon | last post by:
Chapter 3: What are the most common Exceptions and what do they mean? As we saw in the last chapter, there isn't only the standard Exception, but you also get special exceptions like...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.