Dennis Myrén said:
A static constructor should be implemented whenever you have any static
properties defined in the class, to initialize those properties.
It is cleaner to do the initialization in the static constructor than
to directly initialize where declared if you ask me.
Bear in mind that it can have a significant impact on performance to
have a static constructor, as it prevents the compiler adding the
beforefieldinit flag (in C#, anyway).
See
http://www.pobox.com/~skeet/csharp/beforefieldinit.html for more
information.
I also disagree with the readability aspect, personally - I find that
unless two members need to be initialised in some inter-related way,
it's easier to read if you put the declaration and initial assignment
together. Just a matter of personal taste though, I guess.
The static constructor runs when you create an instance of the class where
it is declared or use any static methods declared in the class.
It runs only if there is not any other instance of the assembly currently
running, because then it has already run.
No, if there are other instances of the same actual assembly, each of
them will have a different Type instance for the type, and the static
constructor will run once for each of those Type instances. It's rare
to have the same assembly loaded twice in the same AppDomain, of
course.