3

複数のサーバーとの通信に WCF を使用しています。

私のローカル サーバーでは、netTcpBinding は期待どおりに動作し、問題はありません。

しかし、次の netTcpBinding を使用してリモート サーバー (Azure) に接続しようとするとapp.config、netTcpBinding は完全な信頼なしでは作成できないため、初期化時にアプリケーションがクラッシュします。

app.configファイル内のこのバインディング、

<bindings>
  <netTcpBinding>
    <binding name="NetTcpBinding_IService" closeTimeout="00:01:00"
      openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
      transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
      hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="524288"
      maxBufferSize="65536" maxConnections="10" maxReceivedMessageSize="65536">
      <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
      <reliableSession ordered="true" inactivityTimeout="00:10:00"
        enabled="false" />
      <security mode="Transport">
        <transport clientCredentialType="None" protectionLevel="EncryptAndSign" />
        <message clientCredentialType="Windows" />
      </security>
    </binding>
  </netTcpBinding>
</bindings>

次のエラーが発生します。

"system.serviceModel/bindings" の構成セクション ハンドラーの作成中にエラーが発生しました: そのアセンブリは、部分的に信頼された呼び出し元を許可しません。(K:\Somepath\Testing.exe.Config 行 6)

奇妙なこと:app.configファイルで、他の netTcpBindings に接続するクライアント エンドポイントを取得しました (バインディング セクションでそれらを明示的に宣言せずに)。

これらの一般的な netTcpBindings は部分信頼で機能するのに、上で示したものは機能しないのはなぜですか?

それとも、このエラー メッセージに混乱しているだけで、問題は完全な信頼に関するものではないのでしょうか?

更新: <binding> セクションを削除すると、問題なく実行されます。部分信頼で netTcpBinding を使用することは許可されていますが、パラメーターを変更することは許可されていませんか? 通信を何らかの形で暗号化したいので、これは残念です。

4

1 に答える 1

2

通常、NetTcpBinding は部分信頼環境ではサポートされていません。

基本的な通信は正常に機能しますが (他の環境で見たように)、TransportSecurity や ReliableMessaging などの機能 (サンプル構成に含まれています) は、部分信頼では明示的にサポートされていません(最悪です)。

于 2011-01-26T07:40:11.413 に答える