I'm using Unity with child containers - one main application-level container, and a child container created for each request.
A child container is being created by an HTTP Module for each request, and a WCF InstanceProvider is being used to instantiate the WCF service objects, so they can be built-up and injected.
When the application starts, a simple type mapping is registered - IPatientMapping to PatientMapping.
Immediately after that registration statement executes, I can successfully resolve it... no surprises there.
But, upon the first WCF service call- that same dependency fails to resolve, with the standard "ResolutionFailedException - cannot instantiate because it's an interface."
The strange thing is that the registration shows up shows up in the UnityContainer.Registrations collection while debugging, right before Unity blows up when trying to resolve that very same dependency.
Any ideas (ctavares maybe?) on why Unity might be "ignoring" or "forgetting" this registration?
Like I said, it is still in the Registrations container - so it's not like everything was somehow lost between the app starting, and the first request coming in. Also, it's not like the PatientMapping was never able to be resolved - it was successful
in a test call to .Resolve right after the registration.
I've spent waay too much time on this, and am not looking forward to backing out all our projects form Unity and to another IoC container.
Thanks for any suggestions,