Static CTor, App Domain, Remoting Issue

Jan 20 2004 9:14 AM
Here is the problem. I have two app domains - one of which hosts class A - shall we say, and the other class B. Now - class B has a static constructor that takes a while to initialise all the data - keeping the data in readonly static member data. This object is remoted - such that when the class is called it is instanced and it runs in AppDomain B - this is fine. So far so good. However, also - when it is remoted for the first time, the static CTor gets called from the calling domain as well - in effect the static CTor gets called once from each domain that calls it - and then once in the domain where the object actually exists. As the object only exists in one app domain - and everywhere else is just a proxy - I only want the static ctor being called once. Any ideas? M.