title: Singleton with Dependency Injection
body: <p>I decided to use singleton in order to load some file when the application started and use this configuration throughout the app lifetime as this file is changed once in a year. 
  There is a singleton:</p>
  
  <pre><code> public class Singleton
   {
      private static IReader reader;
  
      private Singleton(IReader reader)
      {
          Singleton.reader = reader;
      }
  
      private static readonly Lazy&lt;Dictionary&lt;string, HashSet&lt;string&gt;&gt;&gt; lazy =
      new Lazy&lt;Dictionary&lt;string, HashSet&lt;string&gt;&gt;&gt;(() =&gt; reader.ReadData("config") );
  
  
      public static Dictionary&lt;string, HashSet&lt;string&gt;&gt; Instance { get { return lazy.Value; } }
  }
  </code></pre>
  
  <p>And on Appstart I have:</p>
  
  <pre><code> IWindsorContainer container = new WindsorContainer();
   container.Install(FromAssembly.This());
  </code></pre>
  
  <p>And on WindsorInstaller I have:</p>
  
  <pre><code>public class WindsorInstaller : IWindsorInstaller
  {
      public void Install(IWindsorContainer container, IConfigurationStore store)
      {
          container.Register(Component.For&lt;IReader&gt;().ImplementedBy&lt;MyReader&gt;());
      }
  }
  </code></pre>
  
  <p>My reader class is following:</p>
  
  <pre><code> public class MyReader : IReader
   {
      public Dictionary&lt;string, HashSet&lt;string&gt;&gt; ReadData(string source)
      {
          /*some code*/
          return dict;
      }
   }
  </code></pre>
  
  <p>It seems that there is no injection happening on Singleton and reader is null and I get error: Object reference not set to an instance of an object. Can you please suggest what I am doing wrong and how to do it better (probably not use singleton at all)?</p>