【发布时间】:2011-12-12 11:38:37
【问题描述】:
我知道通过 configSource 包含配置部分:
Is there any way for an App.config file to reference another full config file? (.NET)
但这不是我想要的。
我有一个这样的容器配置:
<unity xmlns="http://schemas.microsoft.com/practices/2010/unity" >
<alias alias="IFoo" type="Namespace.Foo,Foo.Interface.dll"/>
<alias alias="Foo" type="Namespace.Foo,Foo.dll"/>
<container name="myContainer">
<register type="IFoo" mapTo="Foo" />
</container>
</unity>
现在我想将别名定义移动到一个外部文件中并为他的容器引用它。像这样的:
<unity xmlns="http://schemas.microsoft.com/practices/2010/unity" include="AliasDefinitions.config">
<container name="myContainer" >
<register type="IFoo" mapTo="Foo" />
</container>
</unity>
有什么办法吗?
非常感谢。
【问题讨论】:
标签: unity-container app-config