我在DLL中有配置文件,其中包含system.ServiceModel部分,如下所示
<configuration>
<system.serviceModel>
<bindings>
...
</bindings>
</system.serviceModel>
</configuration>
上面的dll由具有自己的App.config的exe引用 我想引用exe。的App.config中的system.ServiceModel部分。
所以我在exe的App.config中尝试了以下内容。
<configuration>
<connectionStrings configSource="Above.dll.config"/>
<appSettings>
...
</appSettings>
</configuration>
但是我得到了“configSource文件的格式必须是包含该部分名称的元素”ERROR
我猜它是因为在exe“配置”部分的App.config中,在使用configSource之后会有一个“配置”部分作为它的子节点。
我尝试在DLL的配置中没有“配置”部分,但仍然得到相同的错误。
任何人都可以帮我解决这个问题。
PS:我已经解决了许多相关问题,但无法解决此问题