Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying WCF on IIS 8.5

I am attempting to deploy a IIS service application on IIS 8.5 but each time I attemp to connect to the service via http://localhost/test/WCFService.svc I get the following screen:

enter image description here

When I go to turn Windows features On or OFF I have the following:

enter image description here

My web.config looks as follows:

<?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"/>
  </system.web>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name ="MessageServaceBehavior">
          <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>

    </behaviors>
    <services>

      <service name ="WCF_Connection.WCFService" behaviorConfiguration="MessageServaceBehavior">

        <host>
          <baseAddresses>
            <add baseAddress="http://10.0.5.32:58632/WCF_Service/"/>
          </baseAddresses>
        </host>
        <endpoint name ="getMessage" address="" binding="basicHttpBinding" contract="WCF_Connection.IWCFService"/>
         <!--<endpoint name ="MessgaeServiceMex" address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>-->        

      </service>
    </services>

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

       <!-- To browse web app root directory during debugging, set the value below to true.
        Set to false before deployment to avoid disclosing web app folder information.-->

    <directoryBrowse enabled="true"/>
  </system.webServer>

</configuration>

What causes this and how can i fix this problem?

like image 314
Jonathan Avatar asked Jun 30 '14 15:06

Jonathan


People also ask

What are 3 basic WCF configuration required for hosting a WCF service?

There are three types of hosting environments for WCF services: IIS, WAS, and self-hosting. The term “self-hosting” refers to any application that provides its own code to initialize the hosting environment. This includes console, Windows Forms, WPF, and managed Windows services.

What is WCF in IIS?

This topic outlines the basic steps required to create a Windows Communication Foundation (WCF) service that is hosted in Internet Information Services (IIS). This topic assumes you are familiar with IIS and understand how to use the IIS management tool to create and manage IIS applications.

Is WCF supported in .NET 5?

NET 5 support calling WCF services, but won't offer server-side support for hosting WCF. There are two recommended paths for modernizing WCF apps: gRPC is built on modern technologies and has emerged as the most popular choice across the developer community for RPC apps.


1 Answers

You are probably missing WCF HTTP activation feature. It is in different section of Windows Feature screen (look at the screen below) and as far as I know it is not enabled by default when you install IIS.

enter image description here

like image 165
pepo Avatar answered Oct 01 '22 01:10

pepo