.net 增加WCF超时没有成功

.net 增加WCF超时没有成功,.net,wcf,iis,.net,Wcf,Iis,我的WCF服务在60秒后超时,我无法增加超时时间。我增加了web.config和app.config中的所有超时,但结果是一样的。该服务在WIN Server 2012 R2和IIS6上运行,我需要在操作系统级别或服务器本身上进行任何配置更改吗 Web.config: <?xml version="1.0" encoding="utf-8"?> <configuration> <appSettings> <add key="aspnet:UseTaskF

我的WCF服务在60秒后超时,我无法增加超时时间。我增加了web.config和app.config中的所有超时,但结果是一样的。该服务在WIN Server 2012 R2和IIS6上运行,我需要在操作系统级别或服务器本身上进行任何配置更改吗

Web.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>

<system.web>
<compilation debug="false" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" maxRequestLength="2147483647" executionTimeout="600"/>
</system.web>

<system.serviceModel>
<behaviors>
  <serviceBehaviors>
    <behavior name="svcBehavior">
      <!-- Legen Sie die Werte unten vor der Bereitstellung auf "false" fest, um die Veröffentlichung von Metadateninformationen zu vermeiden. -->
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
      <!-- Damit in Fehlern Ausnahmedetails zum Debuggen angezeigt werden, legen Sie den Wert unten auf "true" fest. Legen Sie ihn vor der Bereitstellung auf "false" fest, um die Veröffentlichung von Ausnahmeinformationen zu vermeiden. -->
      <serviceDebug includeExceptionDetailInFaults="true"/>
      <!-- Umgeht eine CommunicationException, die auftritt, wenn der ObjectGraph überläuft -->
      <dataContractSerializer maxItemsInObjectGraph="2147483646"/>
    </behavior>
  </serviceBehaviors>
</behaviors>

<bindings>
  <!-- MTOM Binding für die Übertragung größerer Datenmengen -->
  <wsHttpBinding>
    <binding name="MTOMBinding"
             messageEncoding="Mtom"
             closeTimeout="00:10:00"
             openTimeout="00:10:00"
             sendTimeout="00:10:00"
             receiveTimeout="00:10:00"
             maxBufferPoolSize="2147483647"
             maxReceivedMessageSize="2147483647">
      <readerQuotas maxDepth="2147483647"
                    maxStringContentLength="2147483647"
                    maxArrayLength="2147483647"
                    maxBytesPerRead="2147483647"
                    maxNameTableCharCount="2147483647" />
      <security mode="None">
        <transport clientCredentialType="None" />
        <message clientCredentialType="None" algorithmSuite="Default" />
      </security>
    </binding>
  </wsHttpBinding>
</bindings>

<services>
  <service behaviorConfiguration="svcBehavior" name="DBUpdateService.UpdateService">
    <endpoint address="" binding="wsHttpBinding" bindingConfiguration="MTOMBinding" contract="DBUpdateService.IDBUpdater" />
  </service>
</services>

<protocolMapping>
  <remove scheme="http" />
  <add scheme="http" binding="wsHttpBinding" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<security>
  <requestFiltering>
    <requestLimits maxAllowedContentLength="2147483647" />
  </requestFiltering>
</security>
<modules runAllManagedModulesForAllRequests="true"/>
<!--
    Um das Stammverzeichnis der Webanwendung beim Debuggen auszuwählen, legen Sie den Wert unten auf "true" fest.
    Legen Sie ihn vor der Bereitstellung auf "false" fest, um die Veröffentlichung von Informationen über den Webanwendungsordner zu vermeiden.
  -->
<directoryBrowse enabled="true"/>
</system.webServer>

</configuration>


)方法。

在服务器web.config文件中,尝试创建一个“默认”绑定,复制wsHttpBinding绑定而不使用名称,如下所示:

<wsHttpBinding>
        <binding name="MTOMBinding" closeTimeout="00:10:00" ..... />
        <!-- here is the copy withou name -->
        <binding closeTimeout="00:10:00" ..... />
</wsHttpBinding>

在服务器web.config文件中,尝试创建一个“默认”绑定,复制wsHttpBinding绑定而不使用名称,如下所示:

<wsHttpBinding>
        <binding name="MTOMBinding" closeTimeout="00:10:00" ..... />
        <!-- here is the copy withou name -->
        <binding closeTimeout="00:10:00" ..... />
</wsHttpBinding>

MySqlException

此超时与WCF无关。您可以随意增加WCF限制,数据库仍将关闭

增加方法
ExecuteReaderUGV
中的命令超时或优化查询

看到我能从异常中分辨出什么了吗?这是调试问题的第一个操作。坦白地说,我觉得你自己没有读到这个例外。这是一个常见的错误。现在你知道自己将来怎么做了

MySqlException

此超时与WCF无关。您可以随意增加WCF限制,数据库仍将关闭

增加方法
ExecuteReaderUGV
中的命令超时或优化查询


看到我能从异常中分辨出什么了吗?这是调试问题的第一个操作。坦白地说,我觉得你自己没有读到这个例外。这是一个常见的错误。现在您知道了以后如何执行此操作。

将完整错误发布到字符串。异常:超时已过期。操作完成前已过超时时间,或者服务器没有响应。InnerException:IO操作中的超时不是完全异常。通过编辑问题发布ToString。将完整错误发布到ToString。异常:超时已过期。操作完成前已过超时时间,或者服务器没有响应。InnerException:IO操作中的超时不是完全异常。通过编辑问题发布ToString。无更改。。。我在web.config和app.config中创建了一个默认绑定,但没有区别。您已经完成了所有必要的配置:您的服务中是否使用了任何其他可能导致超时的资源,如文件访问或数据库?涉及数据库,我目前正在检查。没有更改。。。我在web.config和app.config中创建了一个默认绑定,但没有区别。您已经完成了所有必要的配置:您是否在服务中使用了其他可能导致超时的资源,如文件访问或数据库?涉及数据库,我目前正在检查。通过增加MySQLCommand对象的连接超时属性,问题最终得到解决。通过增加MySQLCommand对象的连接超时属性,问题最终得到解决。