While working on a C# app I just noticed that in several places static initializers have dependencies on each other like this:
static private List
Yes, you were lucky. C# appears to execute the code in the order it appears in the class.
static private List a = new List() { 0 };
static private List b = new List() { a[0] };
Will work but ...
static private List b = new List() { a[0] };
static private List a = new List() { 0 };
Will fail.
I would recommend putting all your dependencies in one place, the static constructor is the place for this.
static MyClass()
{
a = new List() { 0 };
b = new List() { a[0] };
}