Adam Hathcock’s Life in Software

Be Explicit 
« Back to blog

Type initialization changes in .NET 4.0

I'd like to stress that none of this should cause your code any problems. The somewhat eager initialization of types without static constructors was entirely legitimate according to the C# and CLR specs, and so the new lazy behaviour of .NET 4.0. If your code assumed that just calling a static method, or creating an instance, would trigger initialization, then that's your own fault to some extent. That doesn't stop it being an interesting change to spot though :)

A good FYI. It should remain the same in .NET 4.0 release...?

Loading mentions Retweet

Comments (0)

Leave a comment...

 
Got an account with one of these? Login here, or just enter your comment below.
Posterous-login    twitter