Configuration Error : Unrecognized attribute 'maxBufferSize'

8.2k views Asked by At

I had a recent change in my web.config file of a wcf REST service, I just added maxBufferSize="10485760" property to it. Please find the code segment below...

<wsHttpBinding>
  <binding name="WSHttpBinding_IService" closeTimeout="00:04:00" 
                 openTimeout="00:04:00" receiveTimeout="00:04:00" sendTimeout="00:04:00" 
                 bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode=
                 "StrongWildcard" maxBufferSize="10485760" maxBufferPoolSize="2147483647"
                 maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8"
                 useDefaultWebProxy="true" allowCookies="false">
  <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" 
                 maxArrayLength="2147483647" maxBytesPerRead="2147483647" 
                 maxNameTableCharCount="2147483647" />
  <reliableSession ordered="true" inactivityTimeout="00:04:00" enabled="false" />
 </binding>
</wsHttpBinding>

After making that change, the application is not working, It is throwing following exception.

Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: Unrecognized attribute 'maxBufferSize'. Note that attribute names are case-sensitive.

If anyone could help on this, that would be great.

1

There are 1 answers

0
David Gregor On BEST ANSWER

Whole your problem is, that wsHttpBinding binding does not have any maxBufferSize property. This property is available in basicHttpBinding for instance. I recomend you to use Visual Studio to modify your bindings in web.config file instead of modifying it directly. Plus you can see available properties for next time. ScreenShot

The wsHttpBinding has property MaxBufferPoolSize, which is something slightly different then MaxBufferSize. Please look at this post to understand the difference