私はここや他の場所で一日中探していたので、冗長性を許してください.
シナリオは、それぞれが独自のプロジェクトで複数の ServiceContracts を提供する 1 つのサービスです。
私は単純に始めています。私のソリューションでは、WCF ServiceLibrary とクラス ライブラリ、および既定の構成ファイルのみを使用しています。
というソリューションに別のプロジェクトがありますWCF_Sandbox.Greeting
。アセンブリ名は WCF_Sandbox.Greeting.dll です。
そのプロジェクトには、クラス IGreeting (ServiceContract として装飾されている) と、実装クラスの Greeting があります。
サービスを介して公開する方法を取得するのに本当に苦労しています。SayHello()
IGreeting
WCF_Sandbox
私はどちらかを取得し続けます
「このサービスは、によって実装されたサービスにリストされていません...」
エラー、またはそのエラー
メタデータはありません。
この他のプロジェクトからサービスを取得して WCF_Sandbox サービスに表示する方法を誰かがアドバイスできる場合は、大いに感謝します。これは多くの人が苦労している基本的な質問のようですが、どこにも簡単に答えられているのを見たことがありません. どうもありがとう!
app.config file. System.Configuration does not support config files for libraries. -->
<system.serviceModel>
<services>
<service name="WCF_Sandbox.Service1">
<host>
<baseAddresses>
<add baseAddress = "http://localhost:8733/Design_Time_Addresses/WCF_Sandbox/Service1/" />
</baseAddresses>
</host>
<endpoint address="" binding="basicHttpBinding" contract="WCF_Sandbox.IService1">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="True" httpsGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>