473,386 Members | 1,801 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,386 software developers and data experts.

Handle Exception over Remoting

riz
Hi

I use Framework 2.0, .Net Remoting, Client with WinForms and a Server.

Everything works fine, but i can't catch Exceptions on the Client, which
have been thrown on the Server.

I would like to catch the ArgumentOutOfRangeException on the Client (if
there is no Person), but it stopps in FindPerson() on the Server.

ArgumentOutOfRangeException is Serializable by default. If i test
FindPerson(1) on the Server with a Test Class. I can catch the
Exception, as it should be. Does anybody know, what i am doing wrong?
Has it something to do with the Interface?
Client communicates with Server like this:
------------------------------------------

IServer server = (IServer)Activator.GetObject(type, url);
//get a Person
try{
server.FindPerson(1);
...
}

//I can't catch it here, but i would like to
catch (ArgumentOutOfRangeException ex) {
MessageBox.Show(ex.Message);
}
Server: IServer
---------------

public Person FindPerson(int id){
try{
return coll.GetPerson(id)[0];
}
catch(Exception e){
throw;
}

}

IServer
-------
public interface IServer {
Person FindPerson (int i);
}

thx
riz
Dec 20 '06 #1
2 1468
Hi Riz,
I would like to catch the ArgumentOutOfRangeException on the Client (if
there is no Person), but it stopps in FindPerson() on the Server.
What do you mean by stops?

What happens on the client?

--
Dave Sexton

"riz" <ri*@newsgroup.comwrote in message
news:em**********@atlas.ip-plus.net...
Hi

I use Framework 2.0, .Net Remoting, Client with WinForms and a Server.

Everything works fine, but i can't catch Exceptions on the Client, which
have been thrown on the Server.

I would like to catch the ArgumentOutOfRangeException on the Client (if
there is no Person), but it stopps in FindPerson() on the Server.

ArgumentOutOfRangeException is Serializable by default. If i test
FindPerson(1) on the Server with a Test Class. I can catch the Exception,
as it should be. Does anybody know, what i am doing wrong? Has it
something to do with the Interface?
Client communicates with Server like this:
------------------------------------------

IServer server = (IServer)Activator.GetObject(type, url);
//get a Person
try{
server.FindPerson(1);
...
}

//I can't catch it here, but i would like to
catch (ArgumentOutOfRangeException ex) {
MessageBox.Show(ex.Message);
}
Server: IServer
---------------

public Person FindPerson(int id){
try{
return coll.GetPerson(id)[0];
}
catch(Exception e){
throw;
}

}

IServer
-------
public interface IServer {
Person FindPerson (int i);
}

thx
riz

Dec 20 '06 #2
riz
Hi Dave,

i just found out. When i run the .exe, it's working. In Visual Studio,
Debugger catches ArgumentOutOfRangeException occurs and i have
to press "continue", then it throws the exception. So i have to use
"Start Without Debugging" CTRL + F5
Dave Sexton wrote:
Hi Riz,

>I would like to catch the ArgumentOutOfRangeException on the Client (if
there is no Person), but it stopps in FindPerson() on the Server.

What do you mean by stops?

What happens on the client?

Dec 20 '06 #3

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

Similar topics

5
by: Vitling | last post by:
For no apparent reason, a NullReference exception is thrown in system.dll (System.Net.Sockets.OverlappedAsyncResult.CompletionPortCallback). Since I only get a disassembly from Visual Studio, it...
0
by: Mono | last post by:
Is there any way to catch (and handle) exceptions in the ProcessPostData or ProcessPostDataSecondTry methods? p.s. From custom web control. Zarko
2
by: lucy | last post by:
Hi, I'm working on a multi-threading web application. I'm using Application_Error event to write exception detail to windows event log to help debug. It seems exception happened in the second...
3
by: elziko | last post by:
I have a procedure that creates a bitmap of a certain size and then displays it in a 3rd party component. However, if the bitmap is very large then a System.OutOfMemoryException is thrown my...
1
by: matt.arens | last post by:
here is some background: I am using the MQSeries/Websphere .Net classes provided by Microsoft. The Websphere Windows Client software is required in order to use the ..Net classes. However, I...
1
by: zeeshansohail | last post by:
Hi, I am facing a problem. As i don't know, how to handle EXCEPTION in ORACLE (PL/SQL). Please if someone can help me to solve out this problem. I will be grateful to him/her. Wating for...
0
by: yogeeswar | last post by:
HI ALL I need to write a SP having a set of deletion queries and any one of query fails then all the previously deleted records need to be rollback. And there is a possibility of deleting a record...
3
by: sudhivns | last post by:
Hi Pals, Application main(), handles the default Exception. However at Method(function) level i want to catch certain exceptions. certain method X(), using all...
9
by: =?Utf-8?B?UmFq?= | last post by:
How do I know which methods will throw exception when I am using FCL or other third party .Net library? I am developer of mostly native Windows applications and now .Net. After working few...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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:
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...

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.