End Google Ads 201810 - BS.net 01 --> App is client/server.
My server creates a single instance of the modules on the client side:
Server code:
DataAccess insDataAccess = DataAccess.Instance;
ObjRef refDataAccess = RemotingServices.Marshal(insDataAccess, "DataAccess");

DataAccess code:
public class DataAccess : MarshalByRefObject
{
private static DataAccess mInstance = null;
public static int trackingVariable = 44;
DataAccess()
{
}
public static DataAccess Instance
{
get
{
if (mInstance == null)
mInstance = new DataAccess();
return mInstance;
}
}
public override Object InitializeLifetimeService()
{
return null;
}
}

For testing purposes, on the client side I have a timer which looks up and displays the value of trackingVariable every second.
On program start it shows the value 44, which is correct.
My server has a timer which changes the value of trackingVariable (in DataAccess) every 10 seconds. This change is not reflected at the client, which means that the server and the client are not using the same instance of DataAccess. Or that's the way it seems to me.

Why? What can I do about it?

The real problem is that the code which runs in DataAccess from timer-tick on the server updates a counter in the database (which it DOES do) and when the counter reaches a certain value it generates an event (which it DOESN'T seem to do). It seems as though the client is subscribed to the event in it's copy of DataAccess and the event is being raised in the server's copy of DataAccess.

In fact, when I raise the event I set trackingVariable to different values, depending on whether or not anything is subscribed to the event, and I cannot see these values either.