0

開発サーバーは HTTP ( http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/c7f173ea-61dc-4338-8883-60d616adc18f/ )以外のバインディングの使用をサポートしていないため、では、NetNamedPipeBinding をどのようにデバッグするのでしょうか?

現在、Microsoft Service Configuration Editor でバインド タイプを basicHttpBinding から netNamedPipeBinding に変更すると、F5 キーを押してポップアップする自動生成された WCF ツールを使用しようとすると、次のエラー メッセージが表示されます。

System.InvalidOperationException: NetNamedPipeBinding をバインドするエンドポイントのスキーム net.pipe に一致するベース アドレスが見つかりませんでした。登録されているベース アドレス スキームは [http] です。System.ServiceModel.ServiceHostBase.MakeAbsoluteUri (Uri relativeOrAbsoluteUri、Binding binding、UriSchemeKeyedCollection baseAddresses) で System.ServiceModel.Description.ConfigLoader.LoadServiceDescription (ServiceHostBase ホスト、ServiceDescription 説明、ServiceElement serviceElement、Action`1 addBaseAddress) で System.ServiceModel.ServiceHostBase. System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader、ServiceDescription の説明、

構成:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
  </configSections>
  <system.web>
    <compilation debug="true" />
  </system.web>
  <!-- When deploying the service library project, the content of the config file must be added to the host's 
  app.config file. System.Configuration does not support config files for libraries. -->
  <system.serviceModel>
    <bindings>
      <netNamedPipeBinding>
        <binding name="NewBinding0" />
      </netNamedPipeBinding>
    </bindings>
    <services>
      <service behaviorConfiguration="InventoryServiceLibrary.Service1Behavior"
        name="InventoryServiceLibrary.InventoryService">
        <endpoint address="" binding="netNamedPipeBinding" bindingConfiguration=""
          contract="InventoryServiceLibrary.IInventoryService">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
          contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8731/Design_Time_Addresses/InventoryServiceLibrary/Service1/" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="InventoryServiceLibrary.Service1Behavior">
          <!-- To avoid disclosing metadata information, 
          set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="True"/>
          <!-- To receive exception details in faults for debugging purposes, 
          set the value below to true.  Set to false before deployment 
          to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="False" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

解決策 名前付きパイプ バインディングを作成した後にベース アドレスを追加する

4

3 に答える 3

3

あなたの設定を見せてください!! クライアントとサーバーの両方。

メッセージ「NetNamedPipeBinding をバインディングするエンドポイントのスキーム net.pipe に一致するベース アドレスが見つかりませんでした。」基本的にはすべてを言います-サーバー構成にバインディングを使用するエンドポイントまたはベースアドレスが含まれていないように見えます:net.pipe

<services>
   <service name="xxxx">
       <host>
           <baseAddresses>
               <add baseAddress="http://localhost:8000/MyService" />
               <add baseAddress="net.tcp://localhost:8100/MyService" />
               <add baseAddress="net.pipe://localhost/" />

net.pipeこのプロトコルを使用するには、サーバーの構成で少なくとも 1 つのエンドポイントを指定する必要もあります。

他の人もコメントしているように、WCF は、ローカル マシンの呼び出しに対してのみ net.pipe バインディングを許可します。たとえば、ある物理マシンから別の物理マシンに呼び出すことはできません。その機能が必要な場合は、代わりに net.tcp バインディングを使用してください。

マルク

于 2009-08-21T05:10:38.217 に答える
1

デバッガーで直接起動する代わりに、Attach To Process をいつでも使用して、ホスト プロセスにアタッチすることができます。

于 2009-08-21T03:31:17.200 に答える