Below is a custom exception class that I created to be shared by my C+
+ and
C# code. It works fine till I need to pass the exception object
through Remoting: every time a FtException is raized in the Remoting
server side, the client got the following error (see below). Based on
my Google search, I did the best I can to have a constructor that
takes SerializationInfo and StreamingContext as input. But it seemed
that
client side still cannot get the constructor to deserialize
FtException object.
What did I do wrong???
Also, how do I write the construction (right now is just a printf
statemet :-) so that I can pass the _errMsg, and _errNo members and
recreate the object on the client side.
Thanks in advance,
Ben
================================================== ==========
[Serializable]
public __gc class FtException : public System::Exception
{
public:
String *_errMsg;
int _errNo;
FtException(System::Runtime::Serialization::Serial izationInfo __gc*
info,
System::Runtime::Serialization::StreamingContext __gc* context);
FtException(int errNo, String* errMsg);
System.Runtime.Serialization.SerializationExceptio n: The constructor
to deserialize an object of type Ft.ServiceUtils.FtException was not
found.
Server stack trace:
at
System.Runtime.Serialization.ObjectManager.Complet eISerializableObject(Object
obj, SerializationInfo info, StreamingContext context)
at
System.Runtime.Serialization.ObjectManager.FixupSp ecialObject(ObjectHolder
holder)
at System.Runtime.Serialization.ObjectManager.DoFixup s()
at
System.Runtime.Serialization.Formatters.Soap.Objec tReader.Deserialize(HeaderHandler
handler, ISerParser serParser)
at
System.Runtime.Serialization.Formatters.Soap.SoapF ormatter.Deserialize(Stream
serializationStream, HeaderHandler handler)
at
System.Runtime.Remoting.Channels.CoreChannel.Deser ializeSoapResponseMessage(Stream
inputStream, IMessage requestMsg, Header[] h, Boolean bStrictBinding)
at
System.Runtime.Remoting.Channels.SoapClientFormatt erSink.DeserializeMessage(IMethodCallMessage
mcm, ITransportHeaders headers, Stream stream)
at
System.Runtime.Remoting.Channels.SoapClientFormatt erSink.SyncProcessMessage(IMessage
msg)
Exception rethrown at [0]:
at Ft.FTConsole.OptionsDialog.tbPolicyServer_KeyUp(Ob ject sender,
KeyEventArgs e) in ....