Q:

The type initializer for 'ClassName' threw an exception

I have a class named 'Utility' which contains several static members. On calling any of those static members, i get an exception 'The type initializer for Utility.cs threw an exception'. I can't figure out what is wrong. Please help! 

A:

You have a static constructor (static Utility() {...this bit...}) or a static field initializer (static SomeType someField = {...this bit...};) that is failing inside Utility. Find out why. You could start by looking at the .InnerException of the exception that is being thrown. 

