title: System.TypeInitializationException: 'The type initializer threw an exception.'
body: <p>I've a simple class MyClass with a method defined in a DLL, now I refer to this DLL in another code and try to initialise object like this <code>Myclass obj = new MyClass()</code>. I'm not sure why compiler is throwing <code>NullReferenceException</code>. Please assist</p>
  
  <p>DLL:</p>
  
  <pre><code>public class MyClass
  {
      public MyClass(){}
      public void method()
      {
           //some code
      }
  }
  </code></pre>
  
  <p>Other code:</p>
  
  <pre><code>void main()
  {
      MyClass obj=new MyClass(); //This is where I get NullReferenceException error
  }
  </code></pre>