Well, I think the problem is this:
- you have a base address for net.tcp
- you have a mex http endpoint defined (but no http address)
Basically, if you want to use MEX via http, you need to specify the full address for the MEX endpoint or the base address of http (if you specify only the relative address).
Solution 1: Indicate the full address of the MEX endpoint:
<services> <service name="FirstWcfService.Service" behaviorConfiguration="ServiceBehavior"> <endpoint address="FirstWcfService" binding="netTcpBinding" contract="FirstWcfService.IService"/> <endpoint address="http://localhost:9102/FirstWcfService/mex" binding="mexHttpBinding" contract="IMetadataExchange" /> ...... </service> </services>
Solution 2: also determines the base address of the HTTP:
<services> <service name="FirstWcfService.Service" behaviorConfiguration="ServiceBehavior"> <endpoint address="FirstWcfService" binding="netTcpBinding" contract="FirstWcfService.IService"/> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> <host> <baseAddresses> <add baseAddress="net.tcp://localhost:9101/"/> <add baseAddress="http://localhost:9102/"/> </baseAddresses> </host> </service> </services>
Solution 3: use mexTcpBinding instead
<services> <service name="FirstWcfService.Service" behaviorConfiguration="ServiceBehavior"> <endpoint address="FirstWcfService" binding="netTcpBinding" contract="FirstWcfService.IService"/> <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" /> ...... </service> </services>
Any of these three options should solve this problem.
Warning: itβs very risky for me to call the configuration of your ServiceBehavior ......
<serviceBehaviors> <behavior name="ServiceBehavior" >
My recommendation: first call your first and standard configuration "Default" (or "DefaultBehavior")
<serviceBehaviors> <behavior name="Default" >
and just start issuing other names if you have several configurations.
Calling this ServiceBehavior just seems to be asking for a problem after a while .....
marc_s
source share