locked
How to replace some other sections that do not allow configSource attrib. RRS feed

  • Question

  • User-466809222 posted

    Hi,

    I love the feature that allows me to replace web.config sections depending on the build configuration. It makes deployment much easier when you have a variety of environments to deploy your project to like dev, QA, UAT, production etc. But there are still some settings in my config file that I need to customize for each build configuration such as system.serviceModel section that keeps settings for my wcf service bindings... I was wondering if this can also be automated by web deployment project.

    any ideas are appreciated.

    Thanks,

    Robert

    Wednesday, November 26, 2008 11:46 PM

Answers

  • User-466809222 posted

    Hi,

    I love the feature that allows me to replace web.config sections depending on the build configuration. It makes deployment much easier when you have a variety of environments to deploy your project to like dev, QA, UAT, production etc. But there are still some settings in my config file that I need to customize for each build configuration such as system.serviceModel section that keeps settings for my wcf service bindings... I was wondering if this can also be automated by web deployment project.

    any ideas are appreciated.

    Thanks,

    Robert

    I have found solution.

    In this case the system.serviceModel cannot be replaced since it is a root for configuration sections. The sections that can be replaced by the web deployment are for example: bindings, client, etc. that are children nodes of system.serviceModel.

    I had to specify those subsections to be replaced like this: system.serviceModel/bindings=bindings.config (where bindings.config is a name of the file where my specific for a build configuration settings are), and the same applies for the client subsection: system.serviceModel/client=client.config.

    Thanks,

    Robert

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, November 28, 2008 1:41 AM

All replies

  • User-466809222 posted

    Hi,

    I love the feature that allows me to replace web.config sections depending on the build configuration. It makes deployment much easier when you have a variety of environments to deploy your project to like dev, QA, UAT, production etc. But there are still some settings in my config file that I need to customize for each build configuration such as system.serviceModel section that keeps settings for my wcf service bindings... I was wondering if this can also be automated by web deployment project.

    any ideas are appreciated.

    Thanks,

    Robert

    I have found solution.

    In this case the system.serviceModel cannot be replaced since it is a root for configuration sections. The sections that can be replaced by the web deployment are for example: bindings, client, etc. that are children nodes of system.serviceModel.

    I had to specify those subsections to be replaced like this: system.serviceModel/bindings=bindings.config (where bindings.config is a name of the file where my specific for a build configuration settings are), and the same applies for the client subsection: system.serviceModel/client=client.config.

    Thanks,

    Robert

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, November 28, 2008 1:41 AM
  • User-833636616 posted

    How are you replacing the bindings section and other sections , can you post the config files please?

    Monday, April 13, 2009 12:09 PM
  • User-681970545 posted

    Hi 

    I'm using VS 2008 SP1 / Framewok 3.5.. configSource attribute is working fine for  the child elements of the Service Model in Framework 2.0. But In the subsequent versions the same attribute configSource is not working.

    As Robert mentioned above we can use system.serviceModel/bindings=bindings.config  like this.

    I have tried like this and also tried without giving the <system.serviceModel>. I'm getting error in both the cases.

    <system.serviceModel>

    <system.serviceModel/bindings=bindings.config/>

    <system.serviceModel/services=services.config/>

    <system.serviceModel/client = client.config/>

    </system.serviceModel> 

    I'm not clear how should I use this.

    I have to badly externalize the child elements of the serviceModel, if possible serviceModel entire section itself..

    please help me out on this at the earliest.

    Thanks

    Deepa

     

    Tuesday, April 28, 2009 6:56 PM