autofac / Autofac

An addictive .NET IoC container
https://autofac.org
MIT License
4.43k stars 834 forks source link

A change to where FindConstructors is called is breaking InterceptedBy #556

Closed Jetski5822 closed 9 years ago

Jetski5822 commented 9 years ago

Hi All, I left a comment on here: https://github.com/autofac/Autofac/commit/f25596a3e15a22a886d6200f34756a4c5ae807a8 However, it might be better to talk about it here.

I am trying to upgrade to the latest Autofac version within Orchard CMS, and this changeset is breaking the upgrade.

It appears that when moving _availableConstructors = _constructorFinder.FindConstructors(_implementationType); to the Ctor that number of parameterless constructors that are returned when using an intercept remains at 1. Where as, if you have an intercept registered, you would expect 2.

What is happening is that AttachToComponentRegistration is called later, and this is where the InterceptedBy method is called.

Do you know how I can resolve this?

Jetski5822 commented 9 years ago

I think the best thing is to revert this changeset and cache the ctor's in a different way, what do you guys think?

alexmg commented 9 years ago

I have pushed a 3.5.2 package with this change to NuGet.