2009-08-20 22 views
0

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

Microsoftサービス構成エディタでバインディングタイプをbasicHttpBindingからnetNamedPipeBindingに変更すると、自動生成されたWCFツールを使用するためにF5キーを押すと次のエラーメッセージが表示されます。

System.InvalidOperationException:バインディングNetNamedPipeBindingを持つエンドポイントのscheme net.pipeに一致するベースアドレスが見つかりませんでした。登録ベースアドレススキームは[http]です。 System.ServiceModel.Description.ConfigLoader.LoadServiceDescriptionでSystem.ServiceModel.ServiceHostBase.MakeAbsoluteUri(URI relativeOrAbsoluteUri、結合が結合、UriSchemeKeyedCollection baseAddresses) (ServiceHostBaseホスト、ServiceDescription記述、ServiceElement serviceElement、Action`1 addBaseAddress) でSystem.ServiceModelでSystem.ServiceModel.ServiceHostBase.ApplyConfigurationでSystem.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternalで.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader、ServiceDescription記述、ServiceElement serviceSection) (ConfigLoader configLoader、ServiceDescriptionの説明、文字列configurationName) ()System.ServiceModelで 。 ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses)01 Microsoft.Tools.SvcHost.ServiceHostHelper.CreateServiceHost(タイプタイプでSystem.ServiceModel.ServiceHost..ctorでSystem.ServiceModel.ServiceHost.InitializeDescription(タイプのServiceType、UriSchemeKeyedCollection baseAddresses) (タイプのServiceType、ウリ[] baseAddresses) で、 Microsoft.Tools.SvcHost.ServiceHostHelper.OpenServiceでServiceKind一種) (SERVICEINFO情報)

設定:

<?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> 

ソリューション 追加名前付きパイプバインドを作成した後のベースアドレス

+1

'net.pipe'ベースアドレスが設定されていますか? –

+1

私はWCFネットパイプがクロスマシンコールをサポートしていないと信じています - あなたはそれをやろうとしていますか? –

+0

設定エディタでnet.pipeを設定する方法が見つかりません。 いいえ、私は同じコンピュータ上の2つのプロセス間で話したいだけです。 –

答えて

3

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

「NetNamedPipeBindingをバインドしてエンドポイントのscheme net.pipeに一致するベースアドレスを見つけることができませんでした」というメッセージ。基本的にはそれをすべて言う - サーバーの設定がないをするかのように見えるでしょうバインディング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/" /> 

をこのプロトコルを使用するにはサーバーの設定を使用します。

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

マーク

1

デバッガで直接起動するのではなく、アタッチするプロセスを使用して、ホストプロセスにアタッチすることができます。

0

これらの回答は誤解を招きます。 WCFサービスを自己ホスティングする場合は、ベースアドレスセクションが必要です。ただし、IISを使用してホスティングしている場合は、必須ではなく、使用されません。

関連する問題