我正在开发一个简单的wcf服务进行测试.当我使用本地IIS 7.5测试此服务时,它便可以正常工作.但是,当我将其托管在Web IIS中时,会收到此错误:
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:
类型'WcfServiceLibrary1.Service1', 作为服务属性提供 ServiceHost指令中的值,或 在配置元素中提供 system.serviceModel/serviceHostingEnvironment/serviceActivations 找不到.
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.
我的ServiceHost是:
And my ServiceHost is:
<%@ ServiceHost Language="C#" Debug="true" Service="WcfServiceLibrary1.Service1" %>请帮助我解决此问题
推荐答案因为在我为此寻找的任何问题中都找不到我建议的问题,所以在这里添加我的案例:
Because I couldn't find this suggested in any of the questions I looked through for this, adding my case here:
当我手动更改文件MyService.svc.cs中的名称空间,并且没有更改相应文件MyService.svc中的服务名称时,我遇到了这个问题-原来它需要为Service ="namespace.classname .
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".
更多推荐
wcf服务中ServiceHost指令中的服务类型问题
发布评论