We are diagnosing an issue which seems to be related to StructureMap and a Registry. A large application of ours is loading a registry, but is experiencing some interesting side-effects.
Without going into all the details, we are seeing issues which we can reproduce by adding the same registry to StructureMap twice. Our assumption is that our application is doing the same, perhaps adding one instance as part of a scan and a second as an explicit registration.
How can I determine if StructureMap has loaded multiple/duplicate instances of this registry?
I would run:
and check its output. If you see multiple registrations for object then you know you have a problem.
Alternatively add logging code to the registry to see if its being called multiple times.