Why did the BeforeFieldInit behavior change in .NET 4?
问题 In C# 4, the behavior of types without the beforefieldinit flag was changed, so now a type initializer can call before first use of any static field of the class. My questions are why has the C#/.NET team changed that behavior? What is the main reason? Can you show any practical example where this change makes any sense? 回答1: The behaviour has always been within the bounds of what's documented - it's just that it changed from being eager to lazy in .NET 4. I suspect the JIT team managed to