简体   繁体   中英

Configuration Error : Unrecognized attribute 'maxBufferSize'

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.

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. 截图

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM