Unable to receive message in the ViewItemWpfUserControl from the BackgroundPlugin

I am sending message from the​ ViewItemWpfUserControl to the Background plugin like this:

_messageCommunication.TransmitMessage(new Message(ABBPlugin_v1Definition.MsgToBackGround) { Data = “StartModbus” }, null, null, null);

In the background i am receiving the message like this

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

_MsgHandlerObject = _messageCommunication.RegisterCommunicationFilter(MsgHandlerBackground, new CommunicationIdFilter(ABBPlugin_v1Definition.MsgToBackGround));

This works, but when im trying to send a message from the BackgroundPlugin to the ViewItemWpfUserControl it does not work. The setup for sending and receiving is the same (with different messageId).

I can receive the message im sending from the backgroundPlugin in the backgroundPlugin, but cant receive it in the ViewItemWpfUserControl.

Not sure what is wrong, because I have gotten this to work earlier.

I am wondering if the BackGround plugin is also running in the same Smart Client. If it is my advise is to use EnvironmentManager.PostMessage and the internal messaging of the EnvironmentManager. What you currently have will communicate via the Event Server.

If the purpose is communication outside the same Smart Client you are on the right track. Then my initial questions are: How and where do initialize and start the message communication classes? If you do so in the constructor the environment might not be ready..