Haven't used this in a long time, but if GetScope now throws instead of returning null, couldn't you fix that in https://github.com/castleprojectcontrib/Castle.Windsor.Lifestyles/blob/master/Castle.Windsor.Lifestyles/HybridScopeAccessor.cs? I'd be happy to merge that. Some additional tests wouldn't hurt.
Cheers -- Mauricio On Wed, May 21, 2014 at 6:20 AM, <[email protected]> wrote: > Hi, > > What I'm trying to do is to register a component with PerWebRequest > Lifestyle, unless the code is running in an explicit Windsor Scope. (Note > this is for a very specific use case - not something I plan to make use of > generally.) > > I tried using the HybridScopeAccessor from Castle.Windsor.Lifestyles > (which tries a bunch of ScopeAccessors in turn, until it finds one that > returns a non-null Scope), configured to try LifetimeScopeAccessor followed > by WebRequestScopeAccessor. > > But LifetimeScopeAccessor throws if it there is no scope found. > > Any tips on either how I could approach this differently or how I can work > around it (obviously I could write my own ScopeAccessor or wrap the > LifetimeScopeAccessor and swallow the exception. > > Thanks, > > Gaz > > -- > You received this message because you are subscribed to the Google Groups > "Castle Project Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected] > . > Visit this group at http://groups.google.com/group/castle-project-users. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Castle Project Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/castle-project-users. For more options, visit https://groups.google.com/d/optout.
