【问题标题】:I'm getting error while running wcf运行 wcf 时出现错误
【发布时间】:2014-07-04 09:27:06
【问题描述】:

我在本地 IIS 上托管服务

我在浏览器上测试服务时不知道为什么会出现这个错误 当我从 Visual Studio 运行时服务工作正常,但当我将它托管在 IIS 上时它不工作

我是第一次这样做。当我从 Visual Studio 运行时,服务运行良好,但当我将其托管在 IIS 上时,它无法正常工作

以下是错误页面的截图。

【问题讨论】:

  • 按照错误说的做,把你的/wcf/虚拟目录配置成一个应用程序。

标签: c# asp.net wcf iis


【解决方案1】:

在服务模型中设置以下

<serviceHostingEnvironment aspNetCompatibilityEnabled="false" multipleSiteBindingsEnabled="true" />
<services>
  <service name="SyncWebServices.Service1" behaviorConfiguration="">
    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="basichttp" contract="SyncWebServices.Service1">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
</services>
<bindings>
  <basicHttpBinding>
    <binding name="basichttp" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:25:00" sendTimeout="00:25:00" maxReceivedMessageSize="4294967296" transferMode="Streamed">
   <readerQuotas maxDepth="4500000" maxStringContentLength="4500000" maxBytesPerRead="40960000" maxNameTableCharCount="250000000" maxArrayLength="4500000" />
      <security mode="None">
      </security>
    </binding>
  </basicHttpBinding>
</bindings>
<behaviors>
  <serviceBehaviors>
    <behavior name="">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" httpHelpPageEnabled="true" />
      <serviceThrottling maxConcurrentCalls="500" maxConcurrentSessions="500" />
    </behavior>
  </serviceBehaviors>
</behaviors>
<standardEndpoints>
  <webHttpEndpoint>
    <standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true" />
  </webHttpEndpoint>
</standardEndpoints>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-11-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多