When you get a popup about this kind of exception in C#, select Break in the popup and then look in your Locals for the innerException property of this exception. It will probably indicate something like “Exception thrown by type initializer of class“, which means you might be trying to do something like get the Length of an uninitialized string.