自己ホスティングからIIS/AppFabricホスティングへのWCFを移植します

StackOverflow https://stackoverflow.com/questions/5358092

  •  27-10-2019
  •  | 
  •  

質問

私は、自己ホストされたファイルにTCP、HTTP、およびMEXバインディングを備えたWCFを持っていますが、すべてがうまく機能します。しかし、私はそれをappfabricに移行し、同じバインディングを保持したいのですが、私はそれをするのに非常に苦労しています。 WCFサービスアプリケーションを追加し、SVCファイルを修正し、自己ホスティングコンソールアプリケーションを削除しましたが、ひどいものを取得し続けます Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [http]. 。エラー。これを機能させるために、app.configからweb.configファイルにどのような変更を宣伝する必要がありますか?私はそれをIISで公開しようともしていませんが...私が取得しているこのエラーはVSのWebサーバーからです
以下は、自己ホーストのための以前のapp.configファイルです。

<configuration>
  <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
      <bindings>
        <basicHttpBinding>
          <binding name="SimpleBinding" />
        </basicHttpBinding>
        <netTcpBinding>
          <binding name="DefaultTCPBinding" closeTimeout="01:00:00" receiveTimeout="01:00:00"
                sendTimeout="01:00:00" transactionFlow="true" transactionProtocol="OleTransactions"
                maxBufferSize="5242880" maxReceivedMessageSize="5242880">
            <reliableSession inactivityTimeout="01:00:00" />
          </binding>
        </netTcpBinding>
        <wsHttpBinding>
          <binding name="RSAlarmEvent" closeTimeout="00:01:00" openTimeout="00:01:00"
              receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false"
              transactionFlow="false" hostNameComparisonMode="StrongWildcard"
              maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
              messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
              allowCookies="false">
            <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                maxBytesPerRead="4096" maxNameTableCharCount="16384" />
            <reliableSession ordered="true" inactivityTimeout="00:10:00"
                enabled="false" />
            <security mode="Message">
              <transport clientCredentialType="Windows" proxyCredentialType="None"
                  realm="" />
              <message clientCredentialType="Windows" negotiateServiceCredential="true"
                  algorithmSuite="Default" />
            </security>
          </binding>
        </wsHttpBinding>
        <webHttpBinding>
          <binding name="ScriptBindig" crossDomainScriptAccessEnabled="true" />
        </webHttpBinding>
      </bindings>
      <behaviors>
        <endpointBehaviors>
          <behavior name="WebScriptBehavior">
            <enableWebScript />
          </behavior>
        </endpointBehaviors>
        <serviceBehaviors>
          <behavior name="MetadataBehavior">
            <serviceMetadata httpGetEnabled="true" httpGetBinding="webHttpBinding"
                  httpGetBindingConfiguration="" />
            <serviceDebug includeExceptionDetailInFaults="true" />
            <serviceThrottling maxConcurrentCalls="64" maxConcurrentSessions="400"
                  maxConcurrentInstances="464" />
          </behavior>
        </serviceBehaviors>
      </behaviors>
      <services>
        <service behaviorConfiguration="MetadataBehavior" name="MyServer.Implementation.MyAppImplementation">
          <endpoint address="" binding="netTcpBinding" bindingConfiguration="DefaultTCPBinding"
                name="MyAppTCPEndpoint" contract="MyServer.Interfaces.IMyApp" />
          <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
                name="MyAppMex" contract="IMetadataExchange" />
          <endpoint address="ws" behaviorConfiguration="" binding="basicHttpBinding"
                bindingConfiguration="SimpleBinding" name="MyApp" contract="MyServer.Interfaces.IMyApp" />
          <host>
            <baseAddresses>
              <add baseAddress="net.tcp://desk01:9878/MyAppService" />
              <add baseAddress="http://desk01:9876/MyAppService/" />
            </baseAddresses>
          </host>
        </service>
      </services>
      <diagnostics>
      <messageLogging logEntireMessage="true"
                      logMalformedMessages="true"
                      logMessagesAtTransportLevel="true" />
    </diagnostics>
  </system.serviceModel>
</configuration>

何を変更する必要がありますか?
TK

役に立ちましたか?

解決

IIS単独では、非HTTPエンドポイントをホストできません。また、Windows Activation Service(WES)をインストールする必要があります。インストールしたら、IIS管理コンソールでサイトのnet.tcpバインディングを有効にする必要があります。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top