G
Guest
Hi
I am running a service on remote machine A and executing some code on same machine from local machine that is machine B. I can create all kinds of objects on remote machines and execute different methods on same. But if there is some exception on remote machine then I am not able to catch it on local machine. Anyone has any idea how this can be done
Please note that I am raising MyException and not Exception
Here is my exception class that I am using on remote machine to catch and throw exception
// This class definition is in a DLL which is referred by remoteservice on remote machine as well as client on local machine which is calling
// different methods from remoteservice on remote machin
public class MyException : ApplicationException
public MyException(string msg): base(message
message = msg
public MyException(SerializationInfo info, StreamingContext context): base(info, context
message = info.GetString("message")
public static MyException CreateException( string message
Trace.WriteLine( DateTime.Now + "\t" + "EXCEPTION MESSAGE" )
Trace.WriteLine( message )
Trace.WriteLine( DateTime.Now + "\t" + "STACK TRACE " )
Trace.WriteLine( stackTrace )
Trace.Flush()
return new MyException( message )
and I am invoking this in RemoteService of Client Activated Object type as
Tr
//Do somethin
catch(Exception e
throw MyException.CreateException(e.message)
Let me know why it does not work
Thanks
Vina
I am running a service on remote machine A and executing some code on same machine from local machine that is machine B. I can create all kinds of objects on remote machines and execute different methods on same. But if there is some exception on remote machine then I am not able to catch it on local machine. Anyone has any idea how this can be done
Please note that I am raising MyException and not Exception
Here is my exception class that I am using on remote machine to catch and throw exception
// This class definition is in a DLL which is referred by remoteservice on remote machine as well as client on local machine which is calling
// different methods from remoteservice on remote machin
public class MyException : ApplicationException
public MyException(string msg): base(message
message = msg
public MyException(SerializationInfo info, StreamingContext context): base(info, context
message = info.GetString("message")
public static MyException CreateException( string message
Trace.WriteLine( DateTime.Now + "\t" + "EXCEPTION MESSAGE" )
Trace.WriteLine( message )
Trace.WriteLine( DateTime.Now + "\t" + "STACK TRACE " )
Trace.WriteLine( stackTrace )
Trace.Flush()
return new MyException( message )
and I am invoking this in RemoteService of Client Activated Object type as
Tr
//Do somethin
catch(Exception e
throw MyException.CreateException(e.message)
Let me know why it does not work
Thanks
Vina