I have created a new wcf4 web application and added a new wcf service.
I created a subfolder and moved the service created into the subfolder.
e.g.
ROOT
ROOT/Business/V1/BusinessV1.svc
I have deployed the service onto my IIS7 enviroment however I keep getting this error
The type
‘MyNameSpace.WebWCF.Business.V1’,
provided as the Service attribute
value in the ServiceHost directive, or
provided in the configuration element
system.serviceModel/serviceHostingEnvironment/serviceActivations
could not be found.
My service file looks like this
<%@ ServiceHost Language="C#" Debug="true"
Service="MyNameSpace.WebWCF.BusinessV1" CodeBehind="BusinessV1.svc.cs" %>
The code behind looks like
namespace MyNameSpace.WebWCF
{
public class BusinessV1 : IBusinessV1
{
}
}
My contract looks like
namespace MyNameSpace.WebWCF
{
[ServiceContract]
public interface IBusinessV1
}
Finally my web.config
<system.serviceModel>
<services>
<service name="MyNameSpace.WebWCF.Business_v1">
<endpoint
address="http://mydomain.com/Business/v1/BusinessV1.svc"
binding="basicHttpBinding"
bindingConfiguration=""
contract="MyNameSpace.WebWCF/IBusinessV1"
listenUri="/" isSystemEndpoint="true" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
Can someone please help me with what I am doing wrong? its driving me crazy.
Well one thing is: your service name isn’t consistent.
In your service implementation class, you have:
and in your
*.svcfile, you have the same qualified name:but in your
web.config, you use:Your service implementation is the one that defines the service name – fully qualified with the namespace:
MyNameSpace.WebWCF.BusinessV1So you need to use this fully qualified name – and exactly that – in your
*.svcfile (OK!) and yourweb.config:Use
MyNameSpace.WebWCF.BusinessV1insstead ofMyNameSpace.WebWCF.Business_v1.If that name doesn’t match, the WCF runtime won’t find the config you’ve specified and will fall back to system defaults