Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
webconfig
HTML
<configuration>

  <appsettings>
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
  </appsettings>
  <system.web>
    <compilation debug="true" targetframework="4.0" />
    <httpruntime />
  </system.web>
  <system.servicemodel>
    <services>
      <service name="MyRESTService.ProductRESTService" behaviorconfiguration="serviceBehavior">
        <endpoint address="">
 binding="webHttpBinding"
                               contract="MyRESTService.IProductRESTService"
                              behaviorConfiguration="web"></endpoint>

        <host>
          <baseAddresses>
            <add baseaddress="http://localhost:50743/MyRESTService/" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <servicebehaviors>
        <behavior name="serviceBehavior">
          <servicemetadata httpgetenabled="true" />
          <servicedebug includeexceptiondetailinfaults="false" />
        </behavior>
      </servicebehaviors>
      <endpointbehaviors>
        <behavior name="web">
          <webhttp />
        </behavior>
      </endpointbehaviors>

    </behaviors>

  </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>

--------------------
my service is

HTML
<%@ ServiceHost Language="C#" Debug="true" Service="MyRESTService.ProductRESTService" CodeBehind="ProductRESTService.svc.cs" %>


-------------------

error is
The type 'MyRESTService.ProductRESTService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.
Posted
Updated 2-Jul-15 23:25pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900