WCF hosting error - system.serviceModelserviceHostingEnvironmentserviceActivations not be found

Last Reply on Aug 06, 2014 06:31 AM By Azim

Posted on Aug 06, 2014 06:23 AM

I have create wcf site it's work on iis but whent im uploading on server it's give an error like -

 

The type 'Service', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found

Config file as below -

<configuration>
  <system.webServer>
    <httpErrors errorMode="Detailed"></httpErrors>
    <asp scriptErrorSentToBrowser="true"></asp>
    <validation validateIntegratedModeConfiguration="false"/>
    <directoryBrowse enabled="true"/>
  </system.webServer>
  <system.web>
    <customErrors mode="Off" defaultRedirect="Service.svc">
      <error statusCode="404" redirect="Service.svc"/>
    </customErrors>
    <trust level="Full"/>   
    <compilation debug="true" targetFramework="4.0">
    </compilation>
  </system.web>
  <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="True" multipleSiteBindingsEnabled="True"></serviceHostingEnvironment>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>  
  </system.serviceModel>
system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>    
</configuration>

Service.svc file as -

<%@ ServiceHost Language="C#" Debug="true" Service="Service" CodeBehind="http~/App_Code/Service.cs" %>

plz help me. Thanks.

Posted on Aug 06, 2014 06:31 AM

Please refer this link

http://stackoverflow.com/questions/720807/wcf-service-attribute-value-in-the-servicehost-directive-could-not-be-found

It is also due to Target Framework problem. Check your WCF and WEB Application Target Framework. It should be same.

I agree, here is the link: https://www.e-iceblue.com/Introduce/spire-office-for-net-free.html