2011-12-29 6 views
1

私はWCFを学びたいと思っています。私はVS2010で新しいWCFサービスライブラリプロジェクトを作成しました。私は既定のプロジェクトに何も変更を加えていませんが、WCFテストクライアントを実行するとエラーが表示されます。ブラウザでメタデータのエンドポイントに移動すると、結果は空白のページになります。新規プロジェクトのテストクライアントエラー

私には何が欠けていますか?私はまったく新しい、手つかずのプロジェクトが正しく動作することを期待していたでしょう。

TestClient Error

ここで完全なエラーです:

Error: An error occurred in the tool.Error: Configuration binding extension 'system.serviceModel/bindings/netTcpRelayBinding' could not be found. Verify that this binding extension is properly registered in system.serviceModel/extensions/bindingExtensions and that it is spelled correctly.

サービスホストが正常に動作しているようです。 service host

ここに設定ファイルがあります。それがあったのと同じように「アウト・オブ・ボックス」

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 

    <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> 
    <services> 
     <service name="SrvLib.Service1"> 
     <host> 
      <baseAddresses> 
      <add baseAddress = "http://localhost:8732/Design_Time_Addresses/SrvLib/Service1/" /> 
      </baseAddresses> 
     </host> 
     <!-- Service Endpoints --> 
     <!-- Unless fully qualified, address is relative to base address supplied above --> 
     <endpoint address ="" binding="wsHttpBinding" contract="SrvLib.IService1"> 
      <!-- 
       Upon deployment, the following identity element should be removed or replaced to reflect the 
       identity under which the deployed service runs. If removed, WCF will infer an appropriate identity 
       automatically. 
      --> 
      <identity> 
      <dns value="localhost"/> 
      </identity> 
     </endpoint> 
     <!-- Metadata Endpoints --> 
     <!-- The Metadata Exchange endpoint is used by the service to describe itself to clients. --> 
     <!-- This endpoint does not use a secure binding and should be secured or removed before deployment --> 
     <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior> 
      <!-- 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> 
+0

ビヘイビア、エンドポイントなどで設定ファイルを投稿できますか? –

+0

ただそれを追加しました。 – BZink

答えて

0

このエラーは通常、.NETフレームワークで使用される「のmachine.config」ファイルに不正な構成が原因で発生します。 Windows Azure SDKをインストールしてアンインストールしたか、AppFabric SDKをアンインストールした可能性があります。いずれにせよ、これらのエラーの原因となっているエントリがいくつかのセクションにあります。 Cで見つかった私のmachine.configからここ

バインディング:\は、Windows \ Microsoft.NET \ Frameworkの\ v4.0.30319 \ CONFIG:

<bindingExtensions> 
    <add name="wsHttpContextBinding" type="System.ServiceModel.Configuration.WSHttpContextBindingCollectionElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> 
    <add name="netTcpContextBinding" type="System.ServiceModel.Configuration.NetTcpContextBindingCollectionElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> 
    <add name="webHttpBinding" type="System.ServiceModel.Configuration.WebHttpBindingCollectionElement, System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> 
    <add name="basicHttpContextBinding" type="System.ServiceModel.Configuration.BasicHttpContextBindingCollectionElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> 
</bindingExtensions> 

あなたがそこに他のエントリを持っており、それらを削除するかどうかを確認してください。

+0

うん。私はAzure sdkに関連していると信じています。 MSDNに関するこの質問は役に立ちました。私はmachine.configをservicebus 1.5.0.0を使用するように更新し、動作し始めました。 http://social.msdn.microsoft.com/Forums/en/wcf/thread/35b20a27-b8e3-495d-b672-01cf5ba9bf36 – BZink

関連する問題