我正在尝试让一个端点在 IIS (Express) 上工作。在 VS 中使用 IIS Express 调试项目并在浏览器中打开端点地址时,我只收到一个正常的 404 错误。
我的 web.config:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug httpHelpPageEnabled="false" includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="A.B.C">
<host>
<baseAddresses>
<add baseAddress="http://localhost:15000"/>
</baseAddresses>
</host>
<endpoint address="Test" binding="basicHttpBinding" contract="A.B.IC" bindingConfiguration="A.B.C">
</endpoint>
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="A.B.C"
maxBufferPoolSize="20971520"
maxBufferSize="2097152"
maxReceivedMessageSize="2097152">
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>
</configuration>
当我将具有以下内容的 .svc-Datei 放入网站根目录时,它工作正常:
<%@ ServiceHost Service="A.B.C" CodeBehind="Services/C.svc.cs" %>