Hi,In commit 1155, it changed the constructor finder to be called in constructor of ReflectionActivator.
"Invoke the IConstructorFinder in the constructor of ReflectionActivator and keep the result in a field instead of invoking on each call to ActivateInstance."It breaks my code in which I replaced constructor finder for my type, and the replaced constructor never get executed.
Cheers,
Jing
Hi Alex,
You are right that IConstructorFinder.FindConstructors is executed. And I finally found what causes my issue.
In commit#1155, it actually changed the execution order of below functions:
1. IConstructorFinder.FindConstructors
2. Module.AttachToComponentRegistration
My IConstructorFinder.FindConstructors relies on some data constructed in Module.AttachToComponentRegistration, I assume these two method happens in reversed order.
Do you have any idea?
Cheers,
Jing
I had a look at this and both configuring the module and creating the registration are calls made through configuration callbacks (executed when the container is being built). This means that the order they are added in is the order they will execute in.
If you configure your module registration on the container builder before adding the registrations that have FindConstructorsWith, the execution order will allow your code to work.
Please let me know if this works for you. I suspect that your particular scenario is probably not very common and I would like to keep the performance optimization if possible.
--
You received this message because you are subscribed to the Google Groups "Autofac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to autofac+u...@googlegroups.com.
To post to this group, send email to aut...@googlegroups.com.
Visit this group at http://groups.google.com/group/autofac?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.