1

これについてはすでに多くの質問がありますが、他の場合には、人々は複数のエンドポイントを持たせようとしているようです。私の場合、エンドポイントは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?!?

4

1 に答える 1

1

これは、Visual Studio2012RCのバグでした。VS 2012RCをインストールしたVS2010を使用していたにもかかわらず、この問題が発生しました。アンインストールすると、この問題は修正されました。コントロールパネルの[プログラムのアンインストール]オプションを使用してアンインストールするとVS2010が破損するため、2012の特定のアンインストール手順に必ず従ってください...私は難しい方法を学びました。

于 2013-03-07T17:04:42.530 に答える