property-injection

Windsor Container: How to specify a public property should not be filled by the container?

When Instantiating a class, Windsor by default treats all public properties of the class as optional dependencies and tries to satisfy them. In my case, this creates a rather complicated circular dependency which causes my application to hang. How can I explicitly tell Castle Windsor that it should not be trying to satisfy a public p...

How can I get Castle Windsor to automatically inject a property?

I have a property on my classes for logging service. private ILogger logger = NullLogger.Instance; public ILogger Logger { get { return logger; } set { logger = value; } } And I have this in my component registration: container.AddFacility<LoggingFacility>(x => new LoggingFacility(LoggerImplementation.Log4net)); However, Wi...

Programatic property injection with Microsoft Unity

I use contructor injection in my solution, but this one class has a property that i do not want to pass in the constructor where i have the invariant dependencies. Let's say i got an ILogger and it has a FileName property i want to set, while still having it set the dependancies in the contructor. How do i go about registering the type,...

How to prevent Castle Windsor from injecting property dependencies?

Is there a way to prevent Castle Windsor from automatically injecting dependencies into properties (besides the [DoNotWire] attribute)? ...

Ninject 2 Property Injection for ActionFilterAttribute not working

I have a method attribute which expects several properties to be injected by Ninject 2, but userSession and jobRepository are coming up as null: [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] public class JobAttribute : ActionFilterAttribute { [Inject] private IUserSession userSession; [Inject] private...

property inject in Autofac

I am compiling: PropertyInject wiki page why this line: builder.RegisterType().InjectProperties(); doesn't compile? how to do property inject in autofac? I am using vs2010, autofac 2.1.13.813. thanks. EDIT: after investigation, PropertyInjection should be like this in new version of AutoFac: builder.RegisterType().PropertiesAutow...

How can StructureMap be used to create setter dependencies of objects that have primitive constructor argumeents?

I have an object "TestProperty" which implements "ITestProperty". "TestProperty" takes a string constructor argument. This is configured in StructureMap using something along the lines CtorDependency or WithCtorArg. I want to inject the an instance of "ITestProperty" (implemented with "TestProperty") into another class as a property. Wh...