title: Why does Unity's RegisterInstance<...> cause Unity to return multiple instances?
body: <p>Unity's documentation says of the RegisterInstance&lt;> method that registers an instance so that <strong>that particular instance is returned everytime Resolve&lt;> is called</strong>. </p>
  
  <p>However, this example below shows that each time Resolve&lt;> is called, <strong>a new instance of the type is returned</strong>.</p>
  
  <p>Why is this?</p>
  
  <pre><code>using System;
  using System.Windows;
  using Microsoft.Practices.Unity;
  
  namespace TestUnity34
  {
      public partial class Window1 : Window
      {
          public Window1()
          {
              InitializeComponent();
  
              Validator validator1 = new Validator();
              IUnityContainer container = new UnityContainer();
              container.RegisterInstance&lt;IValidator&gt;(validator1);
  
              Validator validatorCopied = validator1;
              Console.WriteLine(validator1.GetHashCode()); //14421545
              Console.WriteLine(validatorCopied.GetHashCode()); //14421545
  
              Validator validator2 = container.Resolve&lt;Validator&gt;();
              Console.WriteLine(validator2.GetHashCode()); //35567111
  
              Validator validator3 = container.Resolve&lt;Validator&gt;();
              Console.WriteLine(validator3.GetHashCode()); //65066874
          }
      }
  
      interface IValidator
      {
          void Validate();
          string GetStatus();
      }
  
      public class Validator : IValidator
      {
          public void Validate() { }
  
          public string GetStatus() { return "test"; }
      }
  }
  </code></pre>