私は約15-20のサービスを持っています。各サービスには独自の契約と実装ファイルがあります。私は開発中にデバッグするのがより簡単になるように、コンソールアプリケーションでこれらのサービスをすべてホストしたいと考えています。コンソールのホストWCFサービス
プロジェクト構造
- サービス - ソリューション
- ServiceContracts - プロジェクト
- 実装 - プロジェクト
- のServiceHost - Windowsサービスプロジェクト - 既にインプレースや細かい作業...
- ServiceConsoleHost - プロジェクト - 現在作業中です。私はここにServiceConsoleHostプロジェクト設定ファイルからのサンプルテキストで
app.config
ファイルを持っている
...事前に
<service name="TestpricingService" behaviorConfiguration="HostBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:8000/testService/pricingService"/>
</baseAddresses>
</host>
<!-- use base address provided by host -->
<endpoint address="net.tcp://localhost:820/testService/pricingService"
binding="netTcpBinding"
bindingConfiguration="HostBinding"
contract="Test.Services.Contracts.IpricingService" />
<!-- the mex endpoint is exposed at http://localhost:8000/testService/purchasing/mex -->
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
<behaviors>
<serviceBehaviors>
<behavior name="HostBehavior">
<serviceMetadata httpGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="True" />
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
</behavior>
<behavior name="PooledHostBehavior">
<serviceMetadata httpGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="True" />
<ObjectPoolingServiceBehavior minPoolSize="0" maxPoolSize="5" idleTimeOut="30000"/>
</behavior>
</serviceBehaviors>
</behaviors>
おかげで...あなたはおそらく探している
質問は何ですか? – Rajesh
これらのサービスをコンソールapp-inループでホストするコードが必要です。 – venky
"in loop"とはどういう意味ですか?また、app.configにはnet.tcpバインディングとmexhttpbindingがあり、サービス名は完全修飾されていません。 – Rajesh