我知道通过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>
有没有办法做到这一点?
提前多多感谢。
答案 0 :(得分:0)