trquth / autofac

Automatically exported from code.google.com/p/autofac
Other
0 stars 0 forks source link

ContainerBuilder.Update(IContainer) doesn't activate components registered with .AutoActivate() #454

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create new ContainerBuilder.
2. Build the container.
3. Create another ContainerBuilder.
4. Register some autoactivated components.
5. Update the container with the second builder.

What is the expected output? What do you see instead?
Autoactivated components should be activated after update, but nothing happens.

What version of Autofac are you using? On what version of .NET/Silverlight?
Autofac v3.1.1 on .NET 4.5

Please provide any additional information below.
See the attached unit test.

Original issue reported on code.google.com by atolmac...@netvoxlab.ru on 26 Aug 2013 at 7:47

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by travis.illig on 26 Aug 2013 at 2:55

GoogleCodeExporter commented 8 years ago
This is sort of an interesting scenario that I'll have to think about how it 
should work. We want to make sure that Update doesn't re-activate things that 
are already in the container as AutoActivate/IStartable - it should just 
activate the newly added stuff. Let me look into it.

Original comment by travis.illig on 3 Sep 2013 at 2:54

GoogleCodeExporter commented 8 years ago

Original comment by travis.illig on 3 Sep 2013 at 2:55

GoogleCodeExporter commented 8 years ago

Original comment by travis.illig on 5 Sep 2013 at 3:14

GoogleCodeExporter commented 8 years ago
This issue was closed by revision f40b031554b6.

Original comment by travis.illig on 5 Sep 2013 at 4:03

GoogleCodeExporter commented 8 years ago
Update should now work on both AutoActivate and IStartable if you're updating a 
container. If you're directly updating a component registry (just a set of 
registrations decoupled from any context/lifetime) there's no way to do 
component resolution, so it will ONLY work when updating a container.

Incremented the Autofac core version to 3.1.2 for backwards-compatible bug 
fixes. This feature should be available on next release.

Original comment by travis.illig on 5 Sep 2013 at 4:05

GoogleCodeExporter commented 8 years ago
Excellent! Thanks.

Original comment by atolmac...@netvoxlab.ru on 6 Sep 2013 at 5:18