0

I am trying to host a WCF service in IIS Service 7.5 but from IIS Manager when I try to browse the svc file it is throwing me this error enter image description here

Again when I try to run the svc file from the Visual Studio 2012 itself it opens perfectly from me enter image description here

Where am I doing wrong ? The web.config file is 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>
<services>
  <service name="GreetMeWcfServiceLibrary.GreetMeService">
    <endpoint address="" binding="basicHttpBinding" contract="GreetMeWcfServiceLibrary.IGreetMeService">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior>
      <!-- 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>
 <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>

And I have been trying to define the service first using WCF service library application and then trying to host using WCF service.

Moreover when I right click and click on the WCF configuration of the web.config file it says no service but I have added the reference to that service library dll.

enter image description here

Any help is much appreciated :(

StrugglingCoder
  • 4,781
  • 16
  • 69
  • 103
  • See http://stackoverflow.com/questions/5385714/deploying-website-500-internal-server-error to find the actual error. – CodeCaster May 28 '14 at 12:13

2 Answers2

0

In your WCF project tries to set target FrameWork 4 and perform the publication of the WCF and try again, the configuration file will be different and it should work. Let me know

In your webConfig.xml try this

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

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="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>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>


    <connectionStrings>
      <remove name="XXXXX"/>
      <add name="XXXXXX" connectionString="User ID=sa;Password=XXXX;Initial Catalog=XXXX;Data Source=XXXX\SQLEXPRESS"/>
    </connectionStrings>

</configuration>
daniele3004
  • 13,072
  • 12
  • 67
  • 75
  • What O.S. use in development and which version of VisualStudio? What operating system do you have with IIS 7.5? – daniele3004 May 28 '14 at 07:03
  • Moreover when I right click and click on the WCF configuration of the web.config file it says no service but I have added the reference to that service library dll. – StrugglingCoder May 28 '14 at 07:10
0

I suggest you review the server configuration to make sure all necessary IIS and WCF components are installed and configured properly. The following articles provide an overview of the issue and related troubleshooting suggestions:
http://www.dotnetscraps.com/dotnetscraps/post/e2809cHTTP-Error-50019-Internal-Server-Errore2809d-in-IIS-7-75.aspx
http://forums.iis.net/t/1166889.aspx

Seymour
  • 7,043
  • 12
  • 44
  • 51