Click here to Skip to main content
15,885,033 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
Hello everyone,

I am working with .NET remoting in c# and this work very well with the registered object via:

RemotingConfiguration.RegisterWellKnownServiceType


The object is defined as following:

public class One : System.MarshalByRefObject
{
 private Two _Two = new Two();
 public void  Load(string strFileName)
 {
 }
  
 public Two GetSubObject()
 {
   return Two;
 }
}

[Serialized()]
public class Two
{
 private List<string> _List = new List<string>();
 
 public Two()
 {
  _List.Add("Hello World");
 }

 public long Counter()
 {
   return _cList.Count();
 }

}


From the client side:
1. I can access to Load(...)
2. I cannot retrieve: (Console.WriteLine("Result = {0}", One.GetSubObject().Count())); return 0 and not 1 Why ??.

I have the impression the sub object is not correctly marshalled, I have also tried by adding System.MarshalByRefObject for class Two but this does not make any changes.

Does somebody have an idea about that issue? This would be very helpfull.
Thank you very much in advance
Best regards.
SuperMiQi.
Posted

type [WebMethod]
above
C#
public Two GetSubObject()
 
Share this answer
 
Hello All,
I have found the keyword [Serialize()] is working fine. I just had a error with the eventLog feature in my service.

This works very well for sharing you dataset.

Thank anymway.
Best regards.
MiQi
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900