将app.config的一部分移动到单独的文件中

Rom*_*anT 7 .net configuration app-config

为了方便我的应用程序,我需要在单独的文件中使用app.config的"runtime"元素.

试过像

<runtime file="runtime.conf" />
Run Code Online (Sandbox Code Playgroud)

并且

<runtime configFile="runtime.conf" />
Run Code Online (Sandbox Code Playgroud)

在runtime.conf我有:

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">  
            .......
    </assemblyBinding>
</runtime>
Run Code Online (Sandbox Code Playgroud)

但它被忽略了......

有没有办法找出问题所在.

当然,当我将运行时部分直接复制到app.config时,它可以工作.

我在某个地方发现,当使用configFile ="..."时,包含的文件必须放在子目录中.试了但是它也行不通......

似乎包括不适用于运行时部分.

And*_*are 1

尝试这个:

<runtime configSource="runtime.conf"/>
Run Code Online (Sandbox Code Playgroud)