Questions tagged [castle-windsor-3]

Castle Windsor is a container for dependency injection/IoC (Inversion of Control). This tag is about the version 3 of the library.

Castle Windsor is a container for dependency injection/IoC (Inversion of Control). This tag is about the version 3 of the library.

http://www.castleproject.org/

16 questions
5
votes
1 answer

How to "BeginScope" for a specific Custom Scoped lifestyle in Castle Windsor?

I've created a custom Scope Accessor (it simply returns the DefaultLifetimeScope) to be able to add a custom scoped lifestyle. The component is then registered as Component .For<..> .LifestyleScoped() However, I am at a loss as…
4
votes
1 answer

How to automatically register open generic interface with Castle Windsor?

I need to automatically register my open generic interface to its implementation classes My interface is something like that IIntegrationEventHandler public interface IIntegrationEventHandler where TIntegrationEvent :…
3
votes
1 answer

What causes MethodAccessException during construction of WindsorContainer?

What causes MethodAccessException during construction of WindsorContainer? System.MethodAccessException: Attempt by method 'Castle.MicroKernel.SubSystems.Configuration.DefaultConfigurationStore..ctor()' to access method…
user2368632
  • 990
  • 1
  • 12
  • 33
3
votes
1 answer

Castle windsor lifestyle issue

I am implementing hangFire which is a job scheduling library in my project. I am facing the same issue as faced in this link However after replacing LifestylePerWebRequest() with HybridPerWebRequestTransient() I am still getting the same error…
SJMan
  • 1,547
  • 2
  • 14
  • 37
2
votes
0 answers

Is it possible to name "Forwards" individually and/or differently from the "For" service in Castle Windsor?

I have a service interface that uses generics. That interface has multiple implementations. Those implementations also use generics and provide multiple concrete components for the closed service interface. For (extremely overly simplified)…
Chrisgh
  • 1,016
  • 2
  • 10
  • 18
2
votes
1 answer

Castle Windsor PerWebRequest object injected in Singleton object without referencing it in field

We have created a singleton object (SsoSettingsProvider ) in which we inject object with lifestyle PerWebRequest (IReservationService in our example it is WCF client). In constructor we use this object to get some data and we place this data in a…
2
votes
2 answers

Castle Windsor: Register by convention, open generics

I have an interface like so: public interface IGenericRepository I have a base class like so: public abstract class GenericRepository : IGenericRepository where T : class I have a class like so: public class AGenericRepository :…
Sheldon Cooper
  • 627
  • 4
  • 15
1
vote
1 answer

Named bulk registration with windsor castle

In my project I have the interface IProcess and a lot of classes implementing this interface. I need to register all those implementations. The following code is working fine for…
marco birchler
  • 1,566
  • 2
  • 21
  • 45
1
vote
1 answer

Castle Windsor use component id/name as a parameter

I have a project where I am using Castle Windsor for the dependency injection, more specifically I am using the XML configuration so a common service can be run differently based on parameters. For example (really simplified):
Bayliss15
  • 11
  • 2
1
vote
1 answer

Transient component using a PerWebRequest component, when does the PerWebRequest component go out of scope?

I'm trying to make sense of a somewhat complicated scenario. Basically if I have class X that is registered in Castle as LifestyleTransient(): Component.For() .ImplementedBy() .LifestyleTransient() X looks something like: public X : IX { …
Liam
  • 27,717
  • 28
  • 128
  • 190
1
vote
1 answer

Castle Windsor Interceptor - adding a HTTP Header

I'm trying to add an interceptor to just add a simple HTTP header, is there a nice way of doing this using IInvocation? I've had a look around and can't see any examples of it, or via a WcfPolicy. An example of what I'm trying to do is…
Jamie
  • 876
  • 1
  • 10
  • 28
1
vote
1 answer

Get custom attribute on method from Castle Windsor interceptor

I am trying to access a custom attribute applied to a method within a castle interceptor, but method Attribute.GetCustomAttribute() return null. public class MyIntecept : Castle.DynamicProxy.IInterceptor { public void Intercept(IInvocation…
sp7
  • 246
  • 3
  • 12
0
votes
1 answer

How do I register default interfaces with Castle Windsor given an interface ancestor?

I have the following: interface IAncestor { } interface IDescendant1 : IAncestor { } interface IDescendant2 : IAncestor { } class Descendant1 : IDescendant1 { } class Descendant2 : IDescendant2 { } What I would like to be able to do is…
Diana
  • 789
  • 8
  • 34
0
votes
0 answers

Sitecore 8.1 MVC castle winsdor issue in multiple MVC project

I have implemented one solution using Sitecore 8.1 MVC , Castle Windsor and glass mapper v3.5. In this solution we have two MVC project but it may contains multiple website(Glass_Sample, Glass_Sample_1, and so on) Glass_Global: That’s why…
Sukhjeevan
  • 3,074
  • 9
  • 46
  • 89
0
votes
4 answers

Castle Windsor, overriding convention-registered components

I just started using Castle Windsor (3.3.0) for the very first time and I got stuck on convention based registration. I would like to register as much as possible by name convention (IDummyService -> DummyService): var container = new…
Zdeněk
  • 929
  • 1
  • 8
  • 25
1
2