【发布时间】:2011-02-26 07:37:17
【问题描述】:
我正在使用 Spring.NET 作为 IoC 容器对 WCF 项目进行原型设计。似乎我必须包含对我在 IIS web.config 中使用的所有 Spring.NET 托管程序集的显式引用。
例如,如果我的 WCF 项目正在引用 Spring.NET 托管的 AssemblyA,而后者又引用了 Spring.NET 托管的 AssemblyB,我必须在我的配置文件中包含以下几行,以便解析所有依赖项:
<spring>
<context>
<resource uri="assembly://AssemblyA/ApplicationContext.xml"/>
<resource uri="assembly://AssemblyB/ApplicationContext-Dao.xml"/>
</context>
</spring>
我不能以它们自己“引导”的方式打包 AssemblyA 和 AssemblyB,也许是通过对每个程序集使用 app.config 吗?强迫一个消费应用程序对其依赖项的依赖关系有深入的了解,这对我来说真的很臭,并且违反了 DI 的原则。
我找不到这方面的文档。
非常感谢。
【问题讨论】:
标签: wcf inversion-of-control spring.net bootstrapping