TypeInitializationException thrown for Program class
Another possible reason: the app.config has duplicate sections.
So: either one of the field-initializers, or the static constructor, for Program
- is failing. Find out why. Note: the InnerException
has the actual exception that was raised, but basicaly: just debug the field initializers and static constructor. So look inside the Program
class for either:
static SomeType someField = /* some non-trivial expression or method call */
or:
static Program() {
// stuff
}