ConfigurationManager.GetSection doesn't support compressionFormat RRS feed

  • Question

  • I use the next code to read WCF configuration from config file and it work fine:


    But the above code throws an exception (see below) when I add new (.NET 4.5) compressionFormat attribute:

      <binding name="MyBinding">
    <mtomMessageEncoding compressionFormat="GZip" >

    The exception is: Unrecognized attribute 'compressionFormat'. Note that attribute names are case-sensitive.

    Also the WCF configuration with the compressionFormat attribute work, if I don't use the GetSection code at all in other test app.
    Am I missing something? Looks the GetSection doesn't support new configuration features.

    Monday, June 23, 2014 4:34 AM

All replies

  • Please show code about how do you get the compressionFormat in the ConfigurationManager.GetSection.                    

    • Edited by dns jinung Tuesday, June 24, 2014 6:53 AM
    Tuesday, June 24, 2014 6:53 AM
  • Not sure what are you asking for. All my code is a single line, which I placed in my question. It throws the exception. I don't do anything after or before and there isn't my code anywhere else.


    Wednesday, June 25, 2014 11:26 AM