How can I determine if StructureMap has loaded the same Registry multiple times?

自作多情 提交于 2019-12-06 13:16:58

问题


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?


回答1:


I would run:

container.WhatDoIHave();

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.



来源:https://stackoverflow.com/questions/7812039/how-can-i-determine-if-structuremap-has-loaded-the-same-registry-multiple-times

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!