title: Injecting a property (and overriding constructor setting of same) in Castle Windsor
body: <p>I have a component with a property I'd like to override under certain circumstances.<br>
  Short version is--</p>
  
  <pre><code>public interface IMyClass
  {
    public string SomeValue {get; }
  }
  
  public class MyClass : IMyClass
  {
     public string SomeValue {get; set;}
  
     public MyClass()
     {
       //do nothing related to SomeValue
     }
  
     public MyClass(IHelper helper)
     {
        SomeValue = helper.ReadFromAConfigurationFile();
        //other code follows, unrelated to SomeValue
     }
  }
  </code></pre>
  
  <p>Later on, as suggested <a href="https://stackoverflow.com/questions/5729847/injecting-a-primitive-property-in-a-base-class-with-castle-windsor">here</a> I do..</p>
  
  <pre><code>var classParams= new Dictionary&lt;string, string&gt; { { "SomeValue", "A New Value" } }
  
      Component.For&lt;IMyClass&gt;()
          .ImplementedBy&lt;MyClass&gt;()
          .DependsOn(classParams)
          .Named("NamedInstanceGoesHere")
          .LifestyleTransient());
  </code></pre>
  
  <p>Finally, I resolve my component like this:</p>
  
  <pre><code>var myComponent= container.Resolve&lt;IMyClass&gt;("NamedInstanceGoesHere");
  </code></pre>
  
  <p>When I examine <code>myComponent</code>, the value of <code>SomeValue</code> is as it was set in the constructor and not as I tried to override it.  </p>
  
  <p>Is there a way to do what I'm after?  Why <code>IMyClass</code> doesn't have a public setter for <code>SomeValue</code> and <code>MyClass</code> does I'm not sure, but it's probably contributing to my problem...</p>