Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem with type of service in ServiceHost directive in wcf service

I am developing a simple wcf service for test. When I test this service with my local IIS 7.5, then it works properly. But when I host it in web IIS, I receive this error:

The type 'WcfServiceLibrary1.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.

And my ServiceHost is:

<%@ ServiceHost Language="C#" Debug="true" Service="WcfServiceLibrary1.Service1" %> 

Please help me resolve this problem

like image 760
hamed aj Avatar asked Mar 12 '11 16:03

hamed aj


1 Answers

Because I couldn't find this suggested in any of the questions I looked through for this, adding my case here:

I had this problem when I manually changed the namespace in the file MyService.svc.cs, and did not change the Service name in the corresponding file MyService.svc - turned out that it needed to be Service="namespace.classname".

like image 162
Jac Avatar answered Sep 19 '22 15:09

Jac