title: Getting exception "Value cannot be null" while resolving an object by Unity
body: <p>I've met an exception while resolving the object using <strong>Unity</strong> container:</p>
  
  <blockquote>
    <p>Message   "Value cannot be null.\r\nParameter name: container" 
          Source  "Microsoft.Practices.Unity" string</p>
  </blockquote>
  
  <p>I have a <strong>Prism</strong> application where I have <strong>ServiceModule</strong>. <strong>ServiceModule</strong> just has interface and its implementation:</p>
  
  <pre><code>public interface ICommonService
  {
      string SomeStorage { get; set; }        
  }
  
  public class CommonService : ICommonService
  {
      string fooStorage=DateTime.Now.ToString();
      public string FooStorage
      {
          get
          {
             return fooStorage;
          }
          set
          {
              fooStorage = value;
              OnPropertyChanged("FooStorage");                                
          }
      }
  }
  </code></pre>
  
  <p>I create a single instance of <code>ICommonService</code> in <strong>ViewModelA</strong> of <strong>ModuleA</strong>. It works okay:</p>
  
  <pre><code>unityContainer = new UnityContainer();
  unityContainer.RegisterType&lt;ICommonService, CommonService&gt;(new ContainerControlledLifetimeManager());
  IMyService someFoo = unityContainer.Resolve&lt;ICommonService&gt;();
  someFoo.FooStorage = "AAAOOOBBB";
  </code></pre>
  
  <p>Then I want to read this data in <strong>viewModelB</strong> of <strong>ModuleB</strong>. And this code throws an exception:</p>
  
  <pre><code>ICommonService someFoo = unityContainer.Resolve&lt;ICommonService&gt;();
  string str=someFoo.FooStorage;
  </code></pre>
  
  <p>The exception says:</p>
  
  <blockquote>
    <p>Message   "Value cannot be null.\r\nParameter name: container" 
          Source  "Microsoft.Practices.Unity" string</p>
  </blockquote>
  
  <p>What am I doing wrong? Any help will be greatly appreciated! </p>