How can I specify an alternate config file for a WCF client?

后端 未结 5 1675
礼貌的吻别
礼貌的吻别 2020-12-31 17:08

I am working on a large system, for which I have to use WCF to access a web service. My test code works fine, now I need to integrate my WCF client code into the larger sys

5条回答
  •  心在旅途
    2020-12-31 17:49

    you can't do this as you like - you can come close, but can't do it totally.

    What you could do is add this section to the main app's config file:

    
       
       
       
       
      .....
    
    

    So for each section inside , you could specify an external config file by using the configSource= attribute (and don't let Visual Studio's red squiggly lines confuse it - yes, it DOES work!).

    You can do this for any configuration section - but unfortunately, there's no way to do this for the whole section group ().

    Marc

提交回复
热议问题