See Below Link You may get some idea
http://www.manjuke.com/2009/07/type-initializer-for-threw-exception.html[
^]
and about the exception
First things to check are:
1) Architecture (x86, x64)
2)Crystal Runtime Version
TypeInitializationException occurs when a static constructor has an error. It is thrown from static constructors. It actually wraps the errors from static constructors. It cannot be trapped outside of the static constructor reliably.
The Below Program Shows How this error will come
using System;
class Program
{
static Program()
{
int number = 100;
int denominator = int.Parse("0");
int result = number / denominator;
Console.WriteLine(result);
}
static void Main()
{
}
}
Output
Unhandled Exception: System.TypeInitializationException: The type initializer for
'Program' threw an exception. --->
System.DivideByZeroException: Attempted to divide by zero.
at Program..cctor() in....
--- End of inner exception stack trace ---
at Program.Main()