[Mono-list] Static constructor issue
robertj at gmx.net
Thu Sep 7 14:49:57 EDT 2006
Andreas Färber wrote:
> Isn't the idea of having static (class) constructors to init a class
> before its first use? Doesn't this require the runtime to do
> recursive initialization just like for instance constructors?
> My base class' constructor is not being called before that of my
It's by design. See ECMA 334 (C# specification) section 17.11.
Because non-static ctors are called in reverse order
of the class hierarchy, the static ctors will be called
in that order too, as an artifact of 17.11.
More information about the Mono-list