我正在使用 ASP.Net 路由在127.0.0.1
(在 Win8+IIS8 中)上托管服务,例如
WebServiceHostFactory factory = new WebServiceHostFactory();
RouteTable.Routes.Add(new ServiceRoute("Services/ABC/", factory, typeof(ABCService)));
以及端点的默认行为,例如
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint helpEnabled="false"
automaticFormatSelectionEnabled="true"
faultExceptionEnabled="false"
crossDomainScriptAccessEnabled="true"
defaultOutgoingResponseFormat="Json"
hostNameComparisonMode="StrongWildcard"
transferMode="Streamed">
<security mode="None" />
</standardEndpoint>
</webHttpEndpoint>
</standardEndpoints>
这些设置导致错误A binding instance has already been associated to listen URI 'http://<MachineName>/Services/IMAPI/'. If two endpoints want to share the same ListenUri, they must also share the same binding object instance. The two conflicting endpoints were either specified in AddServiceEndpoint() calls, in a config file, or a combination of AddServiceEndpoint() and config.
我不确定这个错误,为什么它会发生,因为我在 WCF 中没有经验,但是这个错误继续删除 web.config 的标准端点配置。