title: Static constructor for the whole assembly
body: <p>I have many entry points in my assembly and I want some initialization code to be executed once per AppDomain prior to running any other code from this assembly. What would be the best way to do it?</p>
  
  <p>One solution I see is to have a class with static constructor and inherit every entry point I have from it. Something like this:</p>
  
  <pre><code>public class Initializer
  {
      static Initializer()
      {
          EnsureInitialized();  // Calls initialization code once and only once
      }
  }
  
  public class EntryPointOne : Initializer, IEntryPoint
  {
      // Some code here
  }
  
  public class EntryPointTwo : Initializer, IEntryPoint
  {
      // Some code here
  }
  
  // etc.
  </code></pre>
  
  <p>This lets me avoid writing boiler plate static constructors in every entry point but without multi-inheritance this is not always possible. Can you think of any other better options?</p>