vb.net "The type initializer threw an exception" issue

2k Views Asked by At

I encountered this exception when I trying to load a certain page. It doesn't show me which line of code has problem, which makes me kind of dizzy now..

What is a type initializer? What is it used for? and how can I troubleshoot this problem? Any suggestion?

1

There are 1 best solutions below

0
On

Type initializer or static constuctor is block of code that is triggered by the first of the following events to occur within an application domain.

  1. An instance of that class is created
  2. Any of the static member of that class is accessed/referenced.

For more info read articles by Jon skeet.

  1. C# and beforefieldinit (C# in depth chapter)
  2. Type initialization changes in .NET 4.0