Static class variable across appdomain

1.2k views Asked by At

I am building a web server library, that to date; allows php, asp.net and of course, static content.

The main engine of this library lives inside the appdomain of the calling executable.

The library has a class 'Runtime' it's purpose is to store static properties of different types. These properties get populated from within the appdomain of the exe.

Now, the asp.net runtime requires that it lives in a separate domain, and this works without a problem

ApplicationManager.CreateAppDomain(typeof(ASPHost), "/", DocumentRoot)

BUT, from within the asp.net runtime (which is in a separate appdomain) I am not able to obtain my static properties from 'Runtime' (they are not populated when getting there values from the asp.net appdomain)

I don't have much experience with 'MarshallByRefObject', but my searches are bringing this up quite often.

Deriving my 'Runtime' class from 'MarshallByRefObject'

 public class Runtime : MarshalByRefObject

Still results in null/blank values.

1

There are 1 answers

0
Marcus Davies On

Well that was a blowout.

I'd overlooked the fact I have a dictionary of Sockets in my Runtime class, so even if I were to solve this... I will still have a problem of passing objects of this type.