Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF reference in .NET Core

how can I reference WCF to my .NET Core client? I download and install "WCF Service Preview" plugin but when I trying add reference I got error

Error: No endpoints compatible with .Net Core apps were found. An error occurred in the tool.

Failed to generate service reference.

enter image description here

When I try service in my browser, works fine. Any ideas ? My WCF's web config:

<?xml version="1.0"?>
<configuration>

  <appSettings>
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true"/>
  </appSettings>

  <system.web>
    <compilation debug="true" targetFramework="4.5"/>
    <httpRuntime targetFramework="4.5"/>
    <httpModules>
      <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"/>
    </httpModules>
  </system.web>

  <system.serviceModel>
    <services>
      <service name="ServiceLayer.TeamManagementService" behaviorConfiguration="GetDataBehavior">
        <endpoint address="" binding="webHttpBinding" contract="ServiceLayer.ITeamManagementService" behaviorConfiguration="GetDataEndpointBehavior"></endpoint>
      </service>
    </services>

    <behaviors>

      <serviceBehaviors>
        <behavior name="GetDataBehavior">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>

      <endpointBehaviors>
        <behavior name="GetDataEndpointBehavior">
          <webHttp/>
        </behavior>
      </endpointBehaviors>

    </behaviors>

    <protocolMapping>
        <add binding="basicHttpsBinding" scheme="https"/>
    </protocolMapping>    
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
  </system.serviceModel>

  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
      <remove name="ApplicationInsightsWebTracking"/>
      <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"
        preCondition="managedHandler"/>
    </modules>
    <directoryBrowse enabled="true"/>
    <validation validateIntegratedModeConfiguration="false"/>
  </system.webServer>

</configuration>
like image 552
Denis Stephanov Avatar asked Dec 10 '16 12:12

Denis Stephanov


1 Answers

Uncheck Reuse types in referenced assemblies.

like image 57
Collin Price Avatar answered Sep 23 '22 07:09

Collin Price