I got this error when trying to access a Service
The type ‘WebRole1.RestServices.RegisterService’, provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.
This is linked to the definition on the Web.config file
I defined my service like this:
<!-- Service Authenticate -->
<service name="System.Web.ApplicationServices.AuthenticationService" behaviorConfiguration="AuthenticationServiceBehaviors">
<endpoint contract="System.Web.ApplicationServices.AuthenticationService" binding="basicHttpBinding" />
</service>
<!-- Service Register -->
<service name="WebRole1.RestServices.RegisterService" behaviorConfiguration="RegisterServiceBehaviors">
<endpoint contract="WebRole1.RestServices.IRegisterService" binding="basicHttpBinding" />
</service>
The definition working for the Authenticate Service but not for the Register Service.
I am not sure about the name i should put for the service but WebRole1.RestServices is the namespace for the RegisterService.svc
I am sure the error is from the Web.config file. Anyone has an idea how to correct this.
Thx.
Follow these steps from within Visual Studio:
Right click your service file
Select the
View MarkupoptionChange the value of the
Serviceattribute to reflect the fully
qualified path of the underlying
service type.
Make sure the
CodeFileattribute value is also correctThis happens because when you rename the service type in code it doesn’t automatically update the service mark-up directive values appropriately, or at all for that matter.