2011-03-19 30 views
0

我需要做這樣的事情:多個外部文件?

<appSettings> 
    <add key="Three" value="NumberThree"/>  
</appSettings> 
<appSettings configSource="One.config"/> 
<appSettings configSource="Two.config"/> 

這給了我一個錯誤:Sections must only appear once per config file.

這有點兒吮吸:(只是想知道:有什麼辦法/設置我可以讓做這樣的事情?(IIS7,.NET 3.5SP1)

我在web.config中很難控制,並且不能修改現有的appSettings元素,只會增加新的項目。

回答

-1

不知道這是否會幫助你特定的場景。 看一看的file屬性上<appSettings>

<appSettings file="Two.config"> 
    ... 
</appSettings> 

Two.config你就可以做同樣的指向One.config