Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/329.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 运行wcf时出现错误_C#_Asp.net_Wcf_Iis - Fatal编程技术网

C# 运行wcf时出现错误

C# 运行wcf时出现错误,c#,asp.net,wcf,iis,C#,Asp.net,Wcf,Iis,我已在本地IIS上托管服务 在浏览器上测试服务时,我不知道为什么会出现此错误 当我从VisualStudio运行时,服务工作正常,但当我在IIS上托管它时,它不工作 我第一次这样做。当我从VisualStudio运行该服务时,它工作正常,但当我在IIS上托管它时,它就不工作了 以下是错误页面的屏幕截图 在服务模型中设置以下项 按照错误所述,将/wcf/virtual目录配置为应用程序。 <serviceHostingEnvironment aspNetCompatibilityEnabl

我已在本地IIS上托管服务

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

我第一次这样做。当我从VisualStudio运行该服务时,它工作正常,但当我在IIS上托管它时,它就不工作了

以下是错误页面的屏幕截图


在服务模型中设置以下项


按照错误所述,将/wcf/virtual目录配置为应用程序。
<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>