vbNewbie
vbNewbie

Reputation: 3345

WCF Service, the type provided as the service attribute values...could not be found

I have this issue a long time ago and just cannot recall how to resolve it or perphaps its something new. I created a WCF service which I will later use in web application that calls the WCF service amongst others from a remote location. Right now I am trying to host in IIS and even tried the WCFTestClient. The error I get when I try to browse to the service; is the following:

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

I figured its probably my web.config file but I cannot see whats wrong:

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

<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<bindings>
  <webHttpBinding>
    <binding name="webHttpBinding" crossDomainScriptAccessEnabled="false" />
  </webHttpBinding>
</bindings>
<behaviors>
  <endpointBehaviors>
    <behavior name="web">
      <webHttp />
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior name="webHttpBehavior">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>
<services>
  <service behaviorConfiguration="webHttpBehavior" name="WcfInstanceRules2.Service1">
    <endpoint address="" 
     binding="webHttpBinding" 
       contract="WcfRules2.IServiceS"     behaviorConfiguration="web"/>
    <endpoint address="mex" 
    binding="webHttpBinding" contract="IMetadataExchange"></endpoint>
  </service>
</services>

I would like this to be eventually a rest service delivering data in json format.

Upvotes: 0

Views: 7180

Answers (1)

Big Daddy
Big Daddy

Reputation: 5224

Check your .svc file and see what service it's referencing - probably MyService.Service1, which doesn't exist in your config. It looks like it should be referencing WcfInstanceRules2.Service1.

Upvotes: 1

Related Questions