MS PnP Unity是否扫描诸如StructureMap之类的装配体? [英] Does MS PnP Unity Scan for Assemblies Like StructureMap?
问题描述
In Using StructureMap 2.5 to scan all assemblies in a folder, we can see that StructureMap uses AssembliesFromPath()
to explicitly look for types to resolve. What is the equivalent of this in Microsoft Unity? Because Unity is such a generic term, searching for documents about this online is not that easy.
更新:Unity有一个叫做
Update: Unity has something called an Assembly Matching Rule but its description does not communicate to me that it scans folders.
推荐答案
程序集匹配规则用于将侦听应用于Unity构造的类,而不用于容器注册. Unity本身没有任何基于约定的扫描功能,例如StructureMap.虽然有一个CodePlex项目,但它向Unity添加了类似的功能. http://autoregistration.codeplex.com/
The Assembly Matching Rule is used for applying interception to classes constructed by Unity and not for container registration. Unity itself does not have any convention-based scanning functionality like StructureMap. There is a CodePlex project that adds similar functionality to Unity though. http://autoregistration.codeplex.com/
这篇关于MS PnP Unity是否扫描诸如StructureMap之类的装配体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!