[Mono-list] Static constructor issue

Robert Jordan robertj at gmx.net
Thu Sep 7 14:49:57 EDT 2006


Andreas Färber wrote:
> Hello,
> 
> 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  
> subclass.

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.

Robert



More information about the Mono-list mailing list