これについてはすでに多くの質問がありますが、他の場合には、人々は複数のエンドポイントを持たせようとしているようです。私の場合、エンドポイントは1つだけで、必要なのは1つだけです。エラーが発生するのは、証明書トランスポートセキュリティを有効にし、開発マシンでのみ有効にした場合のみです。
MVCのServiceRouteを介してWCFサービスを実装しています。
RouteTable.Routes.Add(new ServiceRoute("MyServices", new WebServiceHostFactory(), typeof(MyServices)));
serviceModel全体は、これだけで構成されます。
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true">
<!--<security mode="Transport">
<transport clientCredentialType="Certificate" />
</security>-->
</standardEndpoint>
</webHttpEndpoint>
</standardEndpoints>
</system.serviceModel>
トランスポートセキュリティがコメント化されている場合、それは正常に機能します。トランスポートセキュリティのコメントを解除すると、次のようになります。
A binding instance has already been associated to listen URI 'https://my.dev.machine.local/MyServices'. 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.
コードを取得して別の環境に配置すると、期待どおりに機能します。WTF?!?