如何调试这个WCF错误?
出现此错误:
无法找到作为 ServiceHost 指令中的 Service 属性值提供的类型“MyCompany.MyNameSpace.MyType”。
尝试运行或引用服务项目时, 解决这个问题吗?
编辑: 这是在 vs 2008 cassini 的 buit 下运行时的情况。
When trying to run or reference the service project I get this error:
The type 'MyCompany.MyNameSpace.MyType', provided as the Service attribute value in the ServiceHost directive could not be found.
Where to look to fix this?
Edit:
This is while running under the buit in vs 2008 cassini.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
该错误消息意味着无法加载指定为服务类型的类型。可以使用 Fusion 加载程序日志来调试类型加载问题。 请参阅此处获取详细说明。
The error message means that the type specified as the Service type couldn't be loaded. Type loading problems can be debugged using the Fusion loader log. See here for a good explanation.
检查您的 svc html 文件中的标记:<%@ ServiceHost Language="C#" Debug="true" Service="Service" CodeBehind="~/App_Code/Service.cs" %>
如果在 IIS 中明确设置,请确保虚拟文件夹是 Web 应用程序
http://jtstroup.net/post/Wcf-Tracing.aspx
Check your svc html file for the tag: <%@ ServiceHost Language="C#" Debug="true" Service="Service" CodeBehind="~/App_Code/Service.cs" %>
If explicitly setup in IIS make sure the virtual folder is a web application
http://jtstroup.net/post/Wcf-Tracing.aspx
WCF,ServiceHost 中的服务属性值找不到指令
WCF, Service attribute value in the ServiceHost directive could not be found