How to Use Windsor without Property Injection

Posted by Grandpappy on Stack Overflow See other posts from Stack Overflow or by Grandpappy
Published on 2010-05-12T15:18:44Z Indexed on 2010/05/12 17:04 UTC
Read the original article Hit count: 392

Filed under:
|

I am attempting to use the WindsorContainer, but I need to turn off Property Injection for the entire container. Here's the code I was trying, but it doesn't seem to have an effect.

this.Container = new WindsorContainer(new XmlInterpreter(new ConfigResource("Dependencies")));
this.Container.Kernel.ComponentModelBuilder.RemoveContributor(
  this.Container.Kernel.ComponentModelBuilder.Contributors.OfType<Castle.MicroKernel.ModelBuilder.Inspectors.PropertiesDependenciesModelInspector>().Single()
);

I'd rather not use the Attribute [DoNotWire] on my properties because I don't want my application to have to know it's running with Windsor.

Any help would be greatly appreciated.

© Stack Overflow or respective owner

Related posts about c#

Related posts about castle-windsor