Chat Sample: The data in the message received is null

​1. I send

2. I receive

3. My code

internal static string MessageIdChatLine = “Chat.Line”;

private void InitAlarm()

   {

       try

       {

           MessageCommunicationManager.Start(EnvironmentManager.Instance.MasterSite.ServerId);

           m\_messageCommunication = MessageCommunicationManager.Get(EnvironmentManager.Instance.MasterSite.ServerId);

           m\_alarmClientManager = new AlarmClientManager();

           m\_alarmClient = m\_alarmClientManager.GetAlarmClient(EnvironmentManager.Instance.MasterSite.ServerId);

           m\_messageCommunication.ConnectionStateChangedEvent += new EventHandler(\_messageCommunication\_ConnectionStateChangedEvent);

           **m\_objChat = m\_messageCommunication.RegisterCommunicationFilter(ChatCallBack, new VideoOS.Platform.Messaging.CommunicationIdFilter(MessageIdChatLine));**

           m\_objAlarm = m\_messageCommunication.RegisterCommunicationFilter(AlarmCallBack, new VideoOS.Platform.Messaging.CommunicationIdFilter(VideoOS.Platform.Messaging.MessageId.Server.NewAlarmIndication), null, EndPointType.Server);

           LoginSettings ls = LoginSettingsCache.GetLoginSettings(EnvironmentManager.Instance.MasterSite);

           m\_myName = ls.UserName;

           if (m\_myName.Contains("\\\\"))

           {

               m\_myName = m\_myName.Split('[\\\\')\[1\];](file://'\)[1];)

           }

           if (m\_messageCommunication.IsConnected)

           {

               m\_messageCommunication.TransmitMessage(

                   new VideoOS.Platform.Messaging.Message(MessageCommunication.WhoAreOnlineRequest), null, null,

                   null);

           }

       }

       catch (Exception)

       {

           EnvironmentManager.Instance.Log(true, "MilestoneDataInteraction InitAlarm()", "Init exception", null);

           throw;

       }

   }

A guess

It is important that if you use a class to pass the communication then the dll in both ends must be the same. I see two ways to workaround or solve.

  1. Make sure that both ends uses the exact same build of the dll.
  2. Make a change so that you use strings instead (perhaps by doing you own serialization and deserialization)