C# Could not find Imetadataexchange

Asked

Viewed 13 times

0

I have the following problem, when creating a WCF service says that Imetadataexchange was not found, my APP.config is:

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

<appSettings>
 <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
 <compilation debug="true" />
</system.web>
<system.serviceModel>
<services>
  <service name="ServiceHostWindows.GetService" >
    <endpoint address="http://localhost:8733/getservice" binding="webHttpBinding" contract="ServiceHostWindows.IGetService">
    </endpoint>
   <endpoint name="MyServiceMex" address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
  </service> 
</services>
<behaviors>
  <endpointBehaviors>
    <behavior>
      <webHttp/>
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior name = "MyBeh">
      <serviceMetadata httpGetEnabled="True" httpsGetEnabled="True"/>
      <serviceDebug includeExceptionDetailInFaults="False" />
    </behavior>
  </serviceBehaviors>
</behaviors>
</system.serviceModel>

</configuration>

I saw a comment asking to add but did not solve the problem, what should I do?

  • remove the line that defines endpoint with name="MyServiceMex"

  • So if I remove the name name="Myservicemex" I get the following message "WCF Service Host cannot find any service metada. This may cause the client application to run improperly. Please check if Metadata is enabled. Do you want to Exit?" If I click YES it closes if I click NO it opens, only when I install the service and try to start the same to say that there is no process using or password the service does not work, actually I do not know if this problem with the meta data that are stopping the service.

1 answer

0

I found, have to add the I found in this reply right here on the forum: [https://stackoverflow.com/questions/50393767/wcf-service-host-cannot-find-any-service-metadata-pleasheck-if-metadata-is-e][1]

Browser other questions tagged

You are not signed in. Login or sign up in order to post.