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

Last post 04-28-2009 6:56 PM by DeepaD. 3 replies.

Sort Posts:

  • How to replace some other sections that do not allow configSource attrib.

    11-26-2008, 11:46 PM
    • Participant
      917 point Participant
    • fafar
    • Member since 07-07-2005, 1:36 AM
    • Toronto, Canada
    • Posts 225

    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

    Robert Kafarski,

    Aure Entuluva!
    - Day shall come again!
  • Re: How to replace some other sections that do not allow configSource attrib.

    11-28-2008, 1:41 AM
    Answer
    • Participant
      917 point Participant
    • fafar
    • Member since 07-07-2005, 1:36 AM
    • Toronto, Canada
    • Posts 225

    fafar:

    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

    Robert Kafarski,

    Aure Entuluva!
    - Day shall come again!
  • Re: How to replace some other sections that do not allow configSource attrib.

    04-13-2009, 12:09 PM
    • Member
      2 point Member
    • sgreddy84
    • Member since 04-13-2009, 4:07 PM
    • Posts 1

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

  • Re: How to replace some other sections that do not allow configSource attrib.

    04-28-2009, 6:56 PM
    • Member
      2 point Member
    • DeepaD
    • Member since 04-28-2009, 6:40 PM
    • Posts 1

    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

     

Page 1 of 1 (4 items)