简体   繁体   English

配置错误:无法识别的属性'maxBufferSize'

[英]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. 我最近在wcf REST服务的web.config文件中进行了更改,我刚刚添加了maxBufferSize="10485760"属性。 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'. 分析器错误消息:无法识别的属性'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. 整个问题是,wsHttpBinding绑定没有任何maxBufferSize属性。 This property is available in basicHttpBinding for instance. 例如,此属性在basicHttpBinding中可用。 I recomend you to use Visual Studio to modify your bindings in web.config file instead of modifying it directly. 我建议您使用Visual Studio修改web.config文件中的绑定,而不是直接修改它。 Plus you can see available properties for next time. 另外,您可以在下次看到可用的属性。 截图

The wsHttpBinding has property MaxBufferPoolSize, which is something slightly different then MaxBufferSize. wsHttpBinding具有属性MaxBufferPoolSize,这与MaxBufferSize略有不同。 Please look at this post to understand the difference 查看这篇文章以了解其中的差异

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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