wcf服务中ServiceHost指令中的服务类型问题

编程入门 行业动态 更新时间:2024-10-11 05:27:19
本文介绍了wcf服务中ServiceHost指令中的服务类型问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在开发一个简单的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指令中的服务类型问题

本文发布于:2023-11-13 04:43:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1583463.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:指令   类型   wcf   ServiceHost

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!