title: StructureMap Setter Injection not setting property
body: <p>I am trying to setup setter/property injection for my MVC project using StructureMap, but I can't seem to get it to set the properties. I am well aware that Constructor injection is the recommended practice, but I have a strict requirement that requires we do it using setter injection, so please hold the comments attempting to tell me otherwise.</p>
  
  <p>I have the normal boilerplate setup code such as the following in my Global.asax</p>
  
  <pre><code>ControllerBuilder.Current.SetControllerFactory(new TestControllerFactory());
  
  ObjectFactory.Initialize(x =&gt; {
              x.For&lt;IPaymentService&gt;().Use&lt;PaymentService&gt;();
              x.ForConcreteType&lt;HomeController&gt;().Configure.Setter&lt;IPaymentService&gt;(y =&gt; y.PaymentService).IsTheDefault();
              x.SetAllProperties(y =&gt;
              {
                  y.OfType&lt;IPaymentService&gt;();
              });
  
          });
  </code></pre>
  
  <p>My TestControllerFactory looks like the following:</p>
  
  <pre><code>public class TestControllerFactory:System.Web.Mvc.DefaultControllerFactory
  {
      protected  IController GetControllerInstance(Type controllerType)
      {
          if (controllerType == null)
              throw new ArgumentNullException("controllerType");
          return ObjectFactory.GetInstance(controllerType) as IController ;
      }
  }
  </code></pre>
  
  <p>I have the following Service/Implementation class pair</p>
  
  <pre><code>public interface IPaymentService
  {
  
  }
  
  public class PaymentService:IPaymentService
  {
  
  }
  </code></pre>
  
  <p>And finally, I have my controller that will have the property that needs to have the concrete payment service implementation injected into it:</p>
  
  <p>public class HomeController:Controller
  {
       public IPaymentService Service {get;set;}</p>
  
  <pre><code> public ActionResult Index(){
          var test = Service... //Service is Null
   }
  </code></pre>
  
  <p>}</p>
  
  <p>Shown above, the property remains null when I debug. </p>
  
  <p>Additionally, I have tried using the [SetterProperty] just to see if it worked(I have no intention of coupling my controllers with those attributes), and it still didnt work.</p>
  
  <p>I am not sure if I need to do something else, or what the problem might be. I have been using constructor injection with StructureMap for quite awhile.</p>