title: Static constructor called more than once
body: <pre><code>using System;
  
  namespace ConsoleApplication15
  {
    using System.Collections.Generic;
    using System.Threading;
  
    public static class Program
    {
      static void Main(string[] args)
      {
        var test1 = new Test&lt;List&lt;int&gt;&gt;();
        var t = new Thread(Tester);
        t.Start();
  
        var test2 = new Test&lt;List&lt;int&gt;&gt;();
        var test3 = new Test&lt;List&lt;int&gt;&gt;();
        var test4 = new Test&lt;List&lt;int&gt;&gt;();
        var test5 = new Test&lt;List&lt;int&gt;&gt;();
  
  
        test1.Do();
        test2.Do();
        test3.Do();
        test4.Do();
        test5.Do();
      }
  
      private static void Tester()
      {
        var test5 = new Test&lt;IList&lt;int&gt;&gt;();
        test5.Do();
      }
    }
  
    public class Test&lt;T&gt; where T : IEnumerable&lt;int&gt;
    {
  
      private static Something something;
  
      static Test()
      {
        Console.WriteLine("IM  static created ");
  
        something = new Something();
        Console.WriteLine(something.ToString());
      }
  
      public Test()
      {
        Console.WriteLine("IM  created ");
      }
  
      public void Do()
      {
        Console.WriteLine("Do something! ");
      }
    }
  
    public class Something
    {
      public Something()
      {
        Console.WriteLine("Create something");
      }
    }
  }
  </code></pre>
  
  <p>When I run the the above code I have exptected that the static construcor in <strong><code>static Test()</code></strong> shall be called one time but when I ran the code the static construcor is called twice!!!!!</p>
  
  <p>When I remove the this line <code>&lt;T&gt; where T : IEnumerable&lt;int&gt;</code>  everything working fine(static construcor called once)?!!!!</p>
  
  <p><img src="https://i.stack.imgur.com/oIqKw.png" alt="This is the breakpoint for the first call">
  <img src="https://i.stack.imgur.com/Aevy6.png" alt="This is the breakpoint for the second call"></p>