J
Jeff
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?
..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?