473,386 Members | 1,734 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.

.NET Remoting and Exceptions

Hey

..NET 2.0

I'm developing a system which consist of a winservice and a client app. The
client app accesses the winservice via .NET Remoting.

In this winservice I'd like to add a method which does some processing and
if an exception occur it will be catched in the client app. (below is an
example code illustrate how I think about implement this). I'm unsure if an
exception is thrown in the winservice, will the client app's try/catch block
catch is exception?

in winservice:
public void HelloWorld()
{
try {
//do something here...
if (!something)
throw new Exception("Happy New Year");
}
catch (Exception e) { throw e}
}

In the client program:
static void Main(string[] args)
{
try
{
//calling remote service......
}
catch (Exception e) { System.Console.WriteLine(e.Message); }

}

If I do it like this will the client try/catch block catch an exception
occuring in the winservice?

any suggestions?
Jan 7 '08 #1
2 2517
I am surprised you bothered to post about this, could you not just
have tried it?

The answer though is yes, in most cases exceptions thrown in the
remote procedural call will filter to the client. The only exception I
have found is if the thrown exception contains any extra information
that is not serializable. However in this case you will still get an
exception in the client it just will not be the original exception.
Jan 7 '08 #2

If you're just starting out, then you might want to go straight to WCF.

WCF is a 3.0 thing, but 3.0 is just an add on to 2.0.

See:
http://sholliday.spaces.live.com/blog/cns!A68482B9628A842A!158.entry


"Jeff" <do***@spam.mewrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Hey

.NET 2.0

I'm developing a system which consist of a winservice and a client app.
The client app accesses the winservice via .NET Remoting.

In this winservice I'd like to add a method which does some processing and
if an exception occur it will be catched in the client app. (below is an
example code illustrate how I think about implement this). I'm unsure if
an exception is thrown in the winservice, will the client app's try/catch
block catch is exception?

in winservice:
public void HelloWorld()
{
try {
//do something here...
if (!something)
throw new Exception("Happy New Year");
}
catch (Exception e) { throw e}
}

In the client program:
static void Main(string[] args)
{
try
{
//calling remote service......
}
catch (Exception e) { System.Console.WriteLine(e.Message); }

}

If I do it like this will the client try/catch block catch an exception
occuring in the winservice?

any suggestions?

Jan 7 '08 #3

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

Similar topics

0
by: Marcio Izepe | last post by:
I am with a problem that I do not obtain to understand. I put a method in the UnhandledException event of AppDomain to capture and log exceptions, however it does not pass for it when I am working...
5
by: Sunny | last post by:
Hi, I have to implement client/server application. The client have to instaniate an remoting object via http and pass some auth info. If the auth is OK, the client should invoke a method (or...
0
by: Simon Stewart \(C# MVP\) | last post by:
Hi Our scenario is: Various business objects on a server using interfaced-based remoting being called by a thick Windows client - all written in .NET 1.1. Objects are running under a domain...
0
by: Mike Peretz | last post by:
I don't know why, but for some reason exception do not serialize correctly when they hold a typed dataset. I have added code to serialize the dataset, but still when it gets to the other appDomain,...
0
by: Felipe Garcia | last post by:
I've built a system in myjob that does the following: We have a page with frames one frame loads the default.aspx and the other frame loads the events.aspx. Inside events.aspx we have a loop...
2
by: Anson | last post by:
Hello, I would like to clarify something about Remoting Object in .NET. Knowing from MSDN that in order for Remote Object to work, I need 3 components. a) RemotableType object, just like a...
3
by: Mike9900 | last post by:
We need to get the correct error message from the .NET Remoting server on the another computer. When we use .NET Remoting the client does not receive correct SQL Server error message if the...
6
by: AMDRIT | last post by:
Hello folks, I appologize for the cross post, but I really need an answer on this: I do not think that I am seeing the whole picture here. I would like to create a windows service and a...
1
by: Thomas René Sidor | last post by:
Hello Having been trying to find the root of this problem for several days I now hope that you can help me. I'm implementing a distributed file system - consisting of, at the moment, a...
1
by: suhas | last post by:
Hi We have .net remoting applications (using .net framework 1.1) I want to implement error handling in much better way to conclude about the problem/failure occurred. What are the standard or...
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: 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
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.