When does a static constructor run in C#?
Correct answer B. Once, automatically, before the first instance is created or any static member is accessed
A static constructor initialises static data. The runtime calls it at most once per type, before the first instance is created or any static member is referenced. It takes no parameters and no access modifiers, and it cannot be called directly. If it throws, the type becomes unusable for the rest of the application domain, raising TypeInitializationException.
Answer checked How we write and check questions
Discussion