Hi,

What happened is that the database query that your remote method SayHelo
performs failed for some reason. You got an exception which Remoting
tried to send back to the client, but that exception object is not
serializable, and that is the error you are getting. Put a try/catch in
the server to see what's the database error.

El dj 13 de 10 del 2005 a les 13:43 +0600, en/na Gayan Perera va
escriure:
> i'm tryign to run a sample application on Mono, following is my
> coding.
> client side coding
> ----------------------------------------------------------------------------------------------------
> 
>             RemotingService.Service f
> =(RemotingService.Service)Activator.GetObject(Type.GetType("RemotingService.Service,RemotingService"),"tcp://127.0.0.1:1026/HeloService");
>             Console.WriteLine("Ready Call Press Enter"); 
>             Console.ReadLine();
>             System.Data.DataSet d=f.SayHelo();
> 
>             foreach (System.Data.DataRow r in d.Tables[0].Rows)
>                 Console.WriteLine(r[1].ToString());
> 
>             Console.ReadLine();
> -----------------------------------------------------------------------------------------------------------------------------
> 
> Server Side
> ------------------------------------------------------------------------------------------------------------
>            TcpChannel ch=new TcpChannel(1026);
>             ChannelServices.RegisterChannel(ch);
> 
>             HeloService o=new HeloService();
>             ObjRef
> oref=RemotingServices.Marshal(o,"HeloService",Type.GetType("RemotingService.Service,RemotingService"));
>             
>             Console.WriteLine("Listening......");
>             Console.ReadLine();
> 
>             RemotingServices.Disconnect(o);
>  
> -------------------------------------------------------------------------------------------------------------------------------
> 
> when i run this on windows it works fine but in mono it gives the
> following error
> 
> Unhandled Exception:
> System.Runtime.Serialization.SerializationException: Type
> Mono.Data.Tds.Protocol.TdsInternalException is not marked as
> Serializable.
> 
> Server stack trace:
> in <0x000d4>
> System.Runtime.Serialization.Formatters.Binary.BinaryCommon:CheckSerializable 
> (System.Type type, ISurrogateSelector selector, StreamingContext context)
> in <0x00145>
> System.Runtime.Serialization.Formatters.Binary.ObjectWriter:GetObjectData 
> (System.Object obj, 
> System.Runtime.Serialization.Formatters.Binary.TypeMetadata metadata, 
> System.Object data)
> in <0x00044>
> System.Runtime.Serialization.Formatters.Binary.ObjectWriter:WriteObject 
> (System.IO.BinaryWriter writer, Int64 id, System.Object obj)
> in <0x00108>
> System.Runtime.Serialization.Formatters.Binary.ObjectWriter:WriteObjectInstance
>  (System.IO.BinaryWriter writer, System.Object obj, Boolean isValueObject)
> in <0x0002d>
> System.Runtime.Serialization.Formatters.Binary.ObjectWriter:WriteQueuedObjects
>  (System.IO.BinaryWriter writer)
> in <0x00037>
> System.Runtime.Serialization.Formatters.Binary.ObjectWriter:WriteObjectGraph 
> (System.IO.BinaryWriter writer, System.Object obj, 
> System.Runtime.Remoting.Messaging.Header[] headers)
> in <0x00573>
> System.Runtime.Serialization.Formatters.Binary.MessageFormatter:WriteMethodResponse
>  (System.IO.BinaryWriter writer, System.Object obj, 
> System.Runtime.Remoting.Messaging.Header[] headers, ISurrogateSelector 
> surrogateSelector, StreamingContext context, FormatterAssemblyStyle 
> assemblyFormat, FormatterTypeStyle typeFormat)
> in <0x001ae>
> System.Runtime.Serialization.Formatters.Binary.BinaryFormatter:Serialize 
> (System.IO.Stream serializationStream, System.Object graph, 
> System.Runtime.Remoting.Messaging.Header[] headers)
> in <0x00015>
> System.Runtime.Serialization.Formatters.Binary.BinaryFormatter:Serialize 
> (System.IO.Stream serializationStream, System.Object graph)
> in <0x0043d>
> System.Runtime.Remoting.Channels.BinaryServerFormatterSink:ProcessMessage 
> (IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders 
> requestHeaders, System.IO.Stream requestStream, IMessage responseMsg, 
> ITransportHeaders responseHeaders, System.IO.Stream responseStream)
> 
> Exception rethrown at [0]:
> 
> in <0x006dc> System.Runtime.Remoting.Proxies.RealProxy:PrivateInvoke
> (System.Runtime.Remoting.Proxies.RealProxy rp, IMessage msg,
> System.Exception exc, System.Object[] out_args)
> 
> 
> if any body knows the reason for this please let me know, and a
> solution to recover from this.
> 
> thank you,
> Gayan.
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list

_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to