![Inline image 1](http://2000thingscsharp.files.wordpress.com/2013/07/878-001.png?w=630&h=343)
If any exception is thrown from within a static constructor, a TypeInitializationException will be thrown, with an InnerException set to the original exception that occurred. If this exception is not caught, the application will be terminated.
public class Dog
{
public static string Motto { get; set; }
static Dog()
{
Motto = "Serve humans and chase balls";
throw new Exception("Static Dog constructor threw me");
}
}
Read more: 2,000 Things You Should Know About C#
QR: ![Inline image 2](http://chart.googleapis.com/chart?chs=80x80&cht=qr&choe=UTF-8&chl=http://csharp.2000things.com/2013/07/02/878-unhandled-exceptions-in-static-constructors/)