Jon Skeet said:
The only way to call a virtual method or use an instance field is to
create an instance though, surely... once an object which is an
instance of a type (even if the type is a base class of the most
specific type of the instance, as it were). (Apologies if this doesn't
make sense - I've only had 45 minutes of sleep in the last 30-odd
hours.)
Yep, What I said is what can be found in ECMA.
"4. If not marked BeforeFieldInit then that type's initializer method is
executed at (i.e., is triggered by):
* first access to any static or instance field of that type, or
* first invocation of any static, instance or virtual method of that type"
Of course you are right for that an instace or virtual method can be called
only if the object is created. When an isntance of a class is created the
instance constructor is executed and it triggers the class static
constructor, I believe. Structures, though, can be created without instance
constructor to be executed. In this case static constructor is not called
upon creation. But it will be called if an instace method is called.
No - it *always* sets the flag if you don't include a static
constructor (at least in VS.NET 2003).
Yes, you are right. I was so surprised of this my "discovery" so I was
inspecting my test project in the release subfolder until I was compiling in
debug version.

However, the compiler doesn't put the beforefileinit flag C# specs will
still be satisfied.
"If a static constructor (§17.11) exists in the class,
execution of the static field initializers occurs immediately prior to
executing that static constructor. Otherwise,
the static field initializers are executed at an implementation-dependent
time prior to the first use of a static field
of that class."
Without .beforefieldinit everything is ok as well.
B\rgds
100