none
Creating Custom WCF in sharePoint 2013 RRS feed

  • Question

  • Hello,

    •  I read the following article to create Custom wcf "http://www.robertseso.com/2013/05/adding-custom-wcf-services-to.html".
    • I have followed the steps .
    • when I open the .svc  from browser I got the following error :

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

    How Can I solve it?


    ASk


    • Edited by himo Thursday, June 19, 2014 9:50 AM
    Thursday, June 19, 2014 9:46 AM

Answers

  • http://stackoverflow.com/questions/17591972/wcf-service-the-type-provided-as-the-service-attribute-values-could-not-be-foun

    Turns out the Eval.svc.cs needed its namespace changing to EvalServiceLibary, rather than EvalServiceSite.

    http://www.codeproject.com/Questions/611706/system-serviceModel-serviceHos

     found the solution, just change the endpoint address and added the baseAddress working fine
     
    here is my web.config file
    ---------------------------------------------------------------------

     
    <configuration>
    <system.web>
    <customerrors mode="Off" />
    <compilation debug="true" targetframework="4.0">
    </compilation>
    </system.web>
    <system.servicemodel>
    <servicehostingenvironment aspnetcompatibilityenabled="True" multiplesitebindingsenabled="True">
    </servicehostingenvironment>
    <services>
    <service name="abc.MyService" behaviorconfiguration="MyWCF">
    <endpoint address="http://YourSiteName/MyService.svc" listenuri="/" binding="wsHttpBinding" contract="abc.IMService"></endpoint>

    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    <host>
    <baseAddresses>
    <add baseaddress="http://YourSiteName/" /> </baseAddresses>
    </host>
     
    </service>
    </services>
    <behaviors>
    <servicebehaviors>
    <behavior name="MyWCF">

    <servicemetadata httpgetenabled="true" policyversion="Policy15" />
    <servicedebug includeexceptiondetailinfaults="true" />
    </behavior>
    </servicebehaviors>
    </behaviors>
    </system.servicemodel>
    <system.webserver>
    <modules runallmanagedmodulesforallrequests="true">
    </modules>
    </system.webserver>
    </configuration>

    http://social.msdn.microsoft.com/Forums/en-US/60a8ca68-c85d-4945-93dc-add4014a3474/servicehost-directive-or-provided-in-the-configuration-element?forum=wcf

    http://patrickyong.net/tags/wcf/


    If this helped you resolve your issue, please mark it Answered

    • Marked as answer by JasonGuo Sunday, June 29, 2014 8:52 AM
    Thursday, June 19, 2014 10:33 AM
    Moderator